主要问题:
算法中用到 Spatial correlation sampler 包,使用 pip 在 torch1.6.0环境下安装,不可用。在之前使用 pytorch1.3.1与编译安装包(Pytorch-Correlation-extension-master)的方法在TitanXp上成功运行。编译的方法依然可以通过。
解决方法:
在保证显卡驱动:最新,Cuda:10.1, Torch:1.6.0的情况下, 最终在服务器虚拟环境内安装GCC-5.4.0重新编译Pytorch-Correlation-extension-master,即可成功运行。
Tips:
-
根据cuda版本查找对应的pytorch,https://pytorch.org/get-started/previous-versions/
-
Cuda与nvidia驱动匹配:https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html,驱动是向下匹配,安装最新即可。
-
GCC版本不匹配,可以用Conda安装,再建立软链。
- https://www.zhihu.com/question/56272908(安装最新GCC)
- https://blog.csdn.net/j___t/article/details/107308883(安装GCC + G++:5.4.0)
-
torch.cuda.is_available()查看Cuda是否可用。
-
显卡算力查询:https://developer.nvidia.com/zh-cn/cuda-gpus
-
查看Cudnn版本:
cat /usr/include/cudnn_version.h | grep CUDNN_MAJOR -A 2
-
不显示warning
import warnings warnings.filterwarnings("ignore")