Detectron ops lib not found
yuyijie1995 opened this issue · comments
yuyijie1995 commented
在编译Detectron官方代码完后运行python2 detectron/tests/test_spatial_narrow_as_op.py
测试时 正常通过,但编译完您的代码后,运行测试代码就会报错
Traceback (most recent call last):
File "detectron/tests/test_spatial_narrow_as_op.py", line 88, in <module>
c2_utils.import_detectron_ops()
File "/home/wrc/CBNet/detectron/utils/c2.py", line 43, in import_detectron_ops
detectron_ops_lib = envu.get_detectron_ops_lib()
File "/home/wrc/CBNet/detectron/utils/env.py", line 71, in get_detectron_ops_lib
('Detectron ops lib not found; make sure that your Caffe2 '
AssertionError: Detectron ops lib not found; make sure that your Caffe2 version includes Detectron module
请问下是不是这个代码只能使用源码编译的方法安装的caffe2
Yudong Liu commented
在编译Detectron官方代码完后运行
python2 detectron/tests/test_spatial_narrow_as_op.py
测试时 正常通过,但编译完您的代码后,运行测试代码就会报错Traceback (most recent call last): File "detectron/tests/test_spatial_narrow_as_op.py", line 88, in <module> c2_utils.import_detectron_ops() File "/home/wrc/CBNet/detectron/utils/c2.py", line 43, in import_detectron_ops detectron_ops_lib = envu.get_detectron_ops_lib() File "/home/wrc/CBNet/detectron/utils/env.py", line 71, in get_detectron_ops_lib ('Detectron ops lib not found; make sure that your Caffe2 ' AssertionError: Detectron ops lib not found; make sure that your Caffe2 version includes Detectron module请问下是不是这个代码只能使用源码编译的方法安装的caffe2
我是源码编译安装的,conda没有试过
jax commented
改一行代码即可解决问题。
修改detectron/utils/env.py的第63行
prefixes = [_CMAKE_INSTALL_PREFIX, sys.prefix, sys.exec_prefix] + sys.path + ["/home/.conda/envs/detectron/lib/python2.7/site-packages/torch/"]
把后面的这个路径改成你自己的就OK了。
yuyijie1995 commented
@cosimo17 感谢大佬 !