-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Troubleshooting
ImportError: No module named swigfaiss
This means that Faiss was not compiled.
cd ../python; swig -Doverride= -python -c++ -DGPU_WRAPPER -o ../python/swigfaiss_gpu_wrap.cxx ../swigfaiss.swig
../gpu/StandardGpuResources.h:67: Error: Syntax error in input(3).
make: *** [../python/swigfaiss_gpu_wrap.cxx] error 1
This is probably because the swig version is too old (swig 2.0 does not parse C++11 >>
), and you may have erased the swig-generated files by doing make clean
. You can restore them by
cd ../python
git checkout swigfaiss_gpu_wrap.cxx swigfaiss_gpu.py swigfaiss_wrap.cxx swigfaiss.py
Then make py
again.
C++ has changed several times how NULL pointers should be represented. In the C++ source, we use nullptr
. To compile on C++03 compilers, we define -Dnullptr=NULL
on the command line. This flag should be removed for newer compilers like GCC 6.3.1
If you get the following assertion error when constructing an GpuIndexIVFPQ
with precomputed tables:
Faiss assertion usePrecomputed_ || IVFPQ::isSupportedNoPrecomputedSubDimSize( this->d / subQuantizers_) failed in void faiss::gpu::GpuIndexIVFPQ::assertSettings_() const at GpuIndexIVFPQ.cu:469Aborted (core dumped)
Then make sure that the ratio between the dimension and the PQ size (d/M) is one of the values mentioned in this function:
If this is not the case, you can pre-process the input vectors with an OPQ transform.
Here you have probably erased the Faiss Makefile or forgotten to copy the makefile.inc
as instructed in the INSTALL
file.
What happens is that make is using a C compiler (cc) to compile C++.
The search performance with OpenBLAS can degrade seriously because of a bad interaction between OpenMP and OpenBLAS threads. To avoid this, export OMP_WAIT_POLICY=PASSIVE
before running the executable. See issue #53
Faiss building blocks: clustering, PCA, quantization
Index IO, cloning and hyper parameter tuning
Threads and asynchronous calls
Inverted list objects and scanners
Indexes that do not fit in RAM
Brute force search without an index
Fast accumulation of PQ and AQ codes (FastScan)
Setting search parameters for one query
Binary hashing index benchmark