본문 바로가기
자연어처리(NLP)/IR(Information Retrieval)

[Faiss][Error] ERROR:in method 'IndexFlatCodes_add', argument 3 of type 'float const *'

by Hyen4110 2023. 1. 11.
반응형

faiss index에 document embedding을
add를 하는 과정에서 아래와 같은 에러 발생

ERROR:in method 'IndexFlatCodes\_add', 
argument 3 of type 'float const \*'

 

구글링을 하니, faiss index 에 add 하는 embedding값은
float 64가 아니라 float32여야한다고 한다.

아래와 같이 변경하여 에러 해결 확인

embeddings = embeddings.astype(np.float32)

 

<참고 자료>

https://github.com/facebookresearch/faiss/issues/461

반응형

댓글