An error occurred while trying to run the โtest_net.pyโ.
ImportError: /.../python3.6/site-packages/torchvision/_C.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN3c1019UndefinedTensorImpl10_singletonE
Please help me.
Wrong version of torchvision, you should reinstall torchvision and reinstall the framework, specifically, you can try to uninstall the torchvision and reinstall a new one, then try to run the script again: python setup.py build develop(before this, you should delete build file), hope it may help you.
Just adding on to what @LYH-YNU mentioned. These types of errors can occur due to incompatibility of packages with each other. You might want to check what your nvcc version is. Then check if your nvidia-drivers correspond to your cuda toolkit version. Once these two are in check make sure that your pytroch and torchvision are compatible with the cuda version.
Here is a list of step you could go through:
nvcc --version (My cuda toolkit version is 10.1)nvidia-smi. On the top right corner of the table produced you can see CUDA Version . Make sure that this is the same as the version of your CUDA toolkit. If not you might want to reinstall your driver.torch.version.cuda. If they don't match with the cuda toolkit version, uninstall and install both pytorch and torchvision.It works fine.
thank you!
Actually, this problem is solved by importing torch before importing _C in my case. No packages or drivers need to be reinstalled.
Most helpful comment
Actually, this problem is solved by importing torch before importing _C in my case. No packages or drivers need to be reinstalled.