0
点赞
收藏
分享

微信扫一扫

linux服务器配置pytorch与pytorch_geometric

caoxingyu 2022-03-18 阅读 90

环境说明:

  • 环境:ubuntus 16(缺少关键文件因此必须不安装pytorch_spline_conv)
  • 显卡:rtx3090ti
  • cuda:11.3
  • anaconda:忘了,无所谓
  • python:3.6 (虚拟环境)

终端核心指令:

# 新建一个虚拟环境
conda create -n <name>

# 激活环境
conda activate <name>

# 使用pip安装 torch-1.10.0+cu113 torchaudio-0.10.0+cu113 torchvision-0.11.0+cu113
pip3 install torch==1.10.0+cu113 torchvision==0.11.0+cu113 torchaudio===0.10.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html

# 使用pip安装 torch-geometric
pip install torch-scatter torch-sparse torch-cluster torch-geometric -f https://data.pyg.org/whl/torch-1.10.0+cu113.html

# 如果ubuntu版本>=18,安装 torch-geometric用下面的
pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.10.0+cu113.html

分析及解释:

  • 效果:无需自己指定channel,因此安装速度快且pip不用检查环境,半小时内能完成环境配置。
  • 解释1:为什么使用pip安装torch不用conda?最关键的原因在于使用conda镜像安装torch时,极有可能指令正确(指定安装gpu版本)但系统安装cpu版本。
  • 解释2:为什么按上述流程不能安装pytorch_spline_conv?因为ubuntu 版本低于18时系统缺少关键文件'GLIBC_2.27',ubuntu版本>=18时不会缺少该文件。
  • 弊端:没有安装pytorch_spline_conv,无法在PyTorch中实现基于样条的SplineCNN卷积运算符。

代码源头:

  • PyTorch
  • Installation — pytorch_geometric 2.0.5 documentation (pytorch-geometric.readthedocs.io)
  • 虽然参考了很多文章,但由于我更加流程化,而且本文位笔记性质,就不再列出
举报

相关推荐

0 条评论