ImportError:..mmcv/_ext.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZNK2at6Tensor6deviceEv解决

简介: ImportError:..mmcv/_ext.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZNK2at6Tensor6deviceEv解决

ERROR:

 File "/home/wsx/.local/lib/python3.6/site-packages/mmdet/apis/inference.py", line 6, in <module>
    from mmcv.ops import RoIPool
  File "/home/wsx/anaconda3/envs/pvt/lib/python3.6/site-packages/mmcv/ops/__init__.py", line 2, in <module>
    from .assign_score_withk import assign_score_withk
  File "/home/wsx/anaconda3/envs/pvt/lib/python3.6/site-packages/mmcv/ops/assign_score_withk.py", line 6, in <module>
    '_ext', ['assign_score_withk_forward', 'assign_score_withk_backward'])
  File "/home/wsx/anaconda3/envs/pvt/lib/python3.6/site-packages/mmcv/utils/ext_loader.py", line 13, in load_ext
    ext = importlib.import_module('mmcv.' + name)
  File "/home/wsx/anaconda3/envs/pvt/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: /home/wsx/anaconda3/envs/pvt/lib/python3.6/site-packages/mmcv/_ext.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZNK2at6Tensor6deviceEv

原因:

mmcv-full版本和pytorch不匹配

Solution:

先卸载之前的版本

pip uninstall mmcv-full

安装新的:

pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.8.1/index.html

tip:

确认cuda版本,上面是cuda=10.1, torch=1.8.1,根据自己需要安装相应版本

nvcc -v确认cuda版本

pip list | grep torch确认torch的版本

结果又报错:

AssertionError: MMCV==1.5.0 is used but incompatible. Please install mmcv>=1.3.2, <=1.4.0

解决:

pip install mmcv-full==1.3.15 -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.8.1/index.html

O了

个人ubuntu 下pvt环境构建

conda install -c pytorch pytorch torchvision  #torch==1.7.0
pip install mmcv-full==1.3.15  -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.7.0/index.html
目录
相关文章
|
1天前
|
Linux 编译器 C语言
|
9月前
|
Ubuntu 计算机视觉 Python
已解决 ImportError:/opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so:undefined symbol:PyCobject Type。
已解决 ImportError:/opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so:undefined symbol:PyCobject Type。
145 0
已解决 ImportError:/opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so:undefined symbol:PyCobject Type。
|
6月前
ImportError: /lib/libgdal.so.26: undefined symbol: sqlite3_column_table_name
ImportError: /lib/libgdal.so.26: undefined symbol: sqlite3_column_table_name
189 0
|
Python
_C.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN2at19UndefinedTensorImpl10_singletonE
_C.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN2at19UndefinedTensorImpl10_singletonE
644 0
|
编译器 Linux
ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found
ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found
1144 0
|
Linux Python Windows
如何 python import h5py 报错 :/defs.cpython-37m-x86_64-linux-gnu.so: undefined symbol: H5Pset_fapl_ros3
如何 python import h5py 报错 :/defs.cpython-37m-x86_64-linux-gnu.so: undefined symbol: H5Pset_fapl_ros3
如何 python import h5py 报错 :/defs.cpython-37m-x86_64-linux-gnu.so: undefined symbol: H5Pset_fapl_ros3
|
Shell Linux
driver: linux2.6 内核模块导出函数实例(EXPORT_SYMBOL) 【转】
转自:http://blog.chinaunix.net/uid-23381466-id-3837650.html 内核版本:2.6.38-11-generic    内核自己都大量利用内核符号表导出函数,那么应该导出呢,ldd3上面说只需要EXPORT_SYMBOL一类的宏导出即可,结果试了很久都不行,最后查看文档,算是明白一点了。
1079 0
|
6天前
|
编译器 Linux 开发工具
|
6天前
|
NoSQL 编译器 开发工具
006.gcc编译器
gcc是什么?
50 0
006.gcc编译器

热门文章

最新文章