Closed
Description
If Faiss is imported after Torch, training in Faiss segfaults.
This can be reproduced using the example k-means clustering code in the Wiki.
Platform
OS: Big Sur version 11.6
Faiss version: 1.7.4 stable
Installed from: conda and brew
conda install faiss-cpu
Faiss compilation options:
Running on:
- CPU
- GPU
Interface:
- C++
- Python
Reproduction instructions
d = 128 # dimension
nb = 100000 # database size
nq = 10000 # nb of queries
np.random.seed(1234) # make reproducible
x = np.random.random((nb, d)).astype('float32')
ncentroids = 1024
niter = 20
verbose = True
d = x.shape[1]
kmeans = faiss.Kmeans(d, ncentroids, niter=niter, verbose=verbose)
kmeans.train(x)