While following the tutorial (linked below), I encountered the following error while trying to add to index.
These are my dimensions for the query and database. They are read from .h5 format to numpy ndarrays.
Shape of Database : (5000000, 512)
Shape of Queries : (42055, 512)
The following is the error.

These are the relevent lines of code in swigfaiss_gpu.py:
def add(self, n, x):
return _swigfaiss_gpu.IndexFlat_add(self, n, x)
_swigfaiss_gpu is a module imported from a .so file. What is wrong with my installation?
OS: Ubuntu 14.04.5 LTS
Faiss version: 1.2.1-py36_cuda8.0.61_2 pytorch
Faiss compilation options: -c pytorch
Running on :
Link to tutorial: https://github.com/facebookresearch/faiss/wiki/Getting-started
You can use any numpy ndarrays of the specified dimensions for this. I used conda install to install faiss on python3.6. swig version is 4.0.0.
After loading the ndarrays,
d = 512
nb = db.shape[0]
nq = queries.shape[0]
index = faiss.IndexFlatL2(d) # build the index
print(index.is_trained)
sys.stdout.flush()
index.add(db) # add vectors to the index <-- ERROR HERE
print(index.ntotal)

TypeError: ndarrays must be of numpy.float32, and not float64.
Closing issue.
Most helpful comment
TypeError: ndarrays must be of numpy.float32, and not float64.
Closing issue.