复现patchGCN需要用到1.6.3版本的torch-geometric,一路上遇到很多困难。
首先我直接pip install torch-geometric==1.6.3,之后运行程序会报错。 这是因为没用安装对应版本的torch-cluster torch-scatter torch-sparse torch-spline-conv。先安装这四个包,再去pip install torch-geometric==1.6.3,这四个包去https://pytorch-geometric.com/whl/找对应的pytorch、cuda版本装。
之后我发现对应版本的torch-geometric需要用低版本的cuda,于是去安装对应的cuda和cudnn,但是由于一个ubuntu使用多个cuda需要软连接,这次安装我这个好像弄错了,所以又没跑成功。cudnn我也安了两次,删除lib64的时候甚至路径搞错了删了系统库,登陆不上服务器,费了一番力气才又搞好。
然后我彻底卸载了没用成功安装的cuda,转而利用conda安装cudatoolkit,然而
print(torch.version.cuda)
和
print(torch.backends.cudnn.version())
查看的都是conda安装的cudatoolkit版本的情况。 查看不了主系统的cuda和cudnn,这样,我按照cuda和pytorch版本安装的torch-geometric又遇到各种奇怪的报错,比如:
1、free(): invalid pointer Aborted (core dumped) (核心转储)
2、AttributeError: Can't get attribute 'DataEdgeAttr
等等,其实都是由于torch-geometric和cuda、pytorch不匹配导致的。
然后,我又重装了主系统的cuda、cudnn,正确添加系统路径。然后再次克隆了之前高版本能运行的环境,删除掉torch、torch-geometric、4个相关组件、cudatoolkit,然后按照、 torch1.7.0(conda安装同时安装了cuda)、4个小组件、torch-geometric的顺序再次安装。又报错,RuntimeError: nvrtc: error: invalid value for --gpu-architecture (-arch),参考RuntimeError: nvrtc: error: invalid value for --gpu-architecture (-arch)_小陈是菜狗的博客-优快云博客和Isaac Gym + 3090 issues - #2 by gstate - Isaac Gym - NVIDIA Developer Forums,使用pip安装了torch1.7.1,然后成功跑通。