OS: Ubintu 14.04
Faiss version:
Faiss compilation options:
Running on :
i installed faiss with INSTALL.MD file
currently, faiss is /usr/lib/python2.7/dist-package
so i tried "import faiss" and "res = faiss.StandardGpuResources()"
i got
'module' object has no attribute 'StandardGpuResources'
so tried
"import faiss" in the directory(faiss-master/python/build/(my-version)/faiss)
i got this error
Failed to load GPU Faiss: ./_swigfaiss_gpu.so: undefined symbol: omp_set_lock
Faiss falling back to CPU-only.
demos/demo_auto_tune.py with "use_gpu = False"
is well performed
but "use_gpu = True",
same error
'module' object has no attribute 'StandardGpuResources'
i modify makefile.inc to
-gencode arch=compute_61,code="compute_61"
-gencode arch=compute_61,code="compute_61"
cuz i use 1080Ti *2,
and
changed to
prefix ?= /usr/
nothig was touched except them
what's the problem.. ? i cannot find similar issue in this github page
Same to you...
I am getting the same AttributeError: module 'faiss' has no attribute 'StandardGpuResources' error, but installed faiss via conda.
Hi
It seems that you installed CPU faiss instead of GPU.
@yurymalkov The current Faiss build on conda depends on the libomp provided by Homebrew. As a temporary workaround, you can do $ brew install libomp (in case you already have Homebrew installed).
The next conda release of Faiss will not have that issue and it will be available promptly.
I had similar issue (AttributeError: module 'faiss' has no attribute 'StandardGpuResources' ).
You can try the following steps to solve:
pip uninstall faiss, cd python; make _swigfaiss_gpu.soimport faiss inside the python directory without installation.cd .. && make -C python installI hope this will help.
No activity. Closing.
5.
cd .. && make -C python install
this is essential.
This problem still happen in faiss-gpu-1.4.0 version through conda install
@beauby , Could you help give the specify conda release that can resolve the problem? Thank you very much !
I also tried faiss-gpu 1.5.0
root@b92569945f26:~# python
Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import faiss
>>> faiss.StandardGpuResources()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'faiss' has no attribute 'StandardGpuResources'
>>>
root@b92569945f26:~# conda list | grep faiss
faiss-gpu 1.5.0 py36_cuda9.0_1 [cuda90] pytorch
@zhjunqin
It might happen that faiss is build for GPU correcly, but the error AttributeError: module 'faiss' has no attribute 'StandardGpuResources' still appears.
The reason for this is that faiss cannot find cuda libraries. Explicitly setting the environmental variable LD_LIBRARY_PATH to point to cuda lib location is solving the problem.
export LD_LIBRARY_PATH='/path/to/cuda/lib'
just go to python folder and make gpu && make install.
As the Faiss conda package is now depending on the cudatoolkit conda package, there shouldn't be issues with Faiss not finding libcudart.so starting with version 1.5.1.
@novioleo Note that the build process was simplified in the latest version, and there is no need to do make gpu in the python folder anymore, but simply make && make install.
As the Faiss conda package is now depending on the
cudatoolkitconda package, there shouldn't be issues with Faiss not findinglibcudart.sostarting with version 1.5.1.@novioleo Note that the build process was simplified in the latest version, and there is no need to do
make gpuin the python folder anymore, but simplymake && make install.
thx for your reply.i'll try the v.1.5.1 release
Most helpful comment
I had similar issue (
AttributeError: module 'faiss' has no attribute 'StandardGpuResources').You can try the following steps to solve:
pip uninstall faiss,cd python; make _swigfaiss_gpu.soimport faissinside thepythondirectory without installation.cd .. && make -C python installI hope this will help.