[PYTHON] Undefined symbol error when importing torchvision

problem

An error occurs when importing torchvision 0.3.0 with pytorch 1.1.0.

ImportError: myenv/lib/python3.7/site-packages/torchvision/_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN3c107Warning4warnENS_14SourceLocationENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

Solution

Uninstall each and reinstall. I don't know what's going on, but I solved it for the time being. The version is the one that suits you. Reference

$conda uninstall pytorch
$conda uninstall torchvision

$conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0 -c pytorch

Recommended Posts

Undefined symbol error when importing torchvision
Error when starting gazebo (gzserver: symbol lookup error: /usr/lib/x86_64-linux-gnu/libgazebo_common.so.9: undefined symbol :)
An error occurs when importing japandas (problem unsolved)
When TypeError appears when importing tensorFlow
Error when playing with python
[Error] Symbol not found: _PyUnicodeUCS2_Compare
polyfit error when installing matplotlib
Solved the problem that sqlite3 got undefined error when cross-compiling Golang
OS Error: could not find or load spatialindex_c-64.dll when importing geopandas
Error in ordinal number when importing Numpy in Anaconda environment of Windows