faiss使用单个GPU与tensorflow训练

问题来源:Youtube2016算法实现线上召回

问题描述:在用线程扫描新的日志时使用的是0GPU跑模型,模型跑完后测试,然后faiss召回也是用的GPU-0,但是出错

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/data/logs/。/yes/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/data/logs/。/yes/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "flask_server_.py", line 295, in update_model
    gpu_index_ivf = faiss.index_cpu_to_gpu(res, 0, index_ivf)
  File "/data/logs/。/yes/lib/python3.7/site-packages/faiss/__init__.py", line 448, in replacement_function
    result = original_function(*args)
  File "/data/logs/。/yes/lib/python3.7/site-packages/faiss/swigfaiss.py", line 5053, in index_cpu_to_gpu
    return _swigfaiss.index_cpu_to_gpu(resources, device, index, options)
RuntimeError: Error in void faiss::gpu::allocMemorySpaceV(faiss::gpu::MemorySpace, void**, size_t) at gpu/utils/MemorySpace.cpp:26: Error: 'err

你可能感兴趣的:(Recommendation)