机器学习_Python对应版本Pytorch及PyG安装
一、torch\torchaudio\torchvision安装
1. python版本与torch版本对应
下表来自pytorch的gituhub官网
torch |
torchvision |
Python |
---|---|---|
main / nightly |
main / nightly |
>=3.8 , <=3.12 |
2.3 |
0.18 |
>=3.8 , <=3.12 |
2.2 |
0.17 |
>=3.8 , <=3.11 |
2.1 |
0.16 |
>=3.8 , <=3.11 |
2.0 |
0.15 |
>=3.8 , <=3.11 |
older versions
torch |
torchvision |
Python |
---|---|---|
1.13 |
0.14 |
>=3.7.2 , <=3.10 |
1.12 |
0.13 |
>=3.7 , <=3.10 |
1.11 |
0.12 |
>=3.7 , <=3.10 |
1.10 |
0.11 |
>=3.6 , <=3.9 |
1.9 |
0.10 |
>=3.6 , <=3.9 |
1.8 |
0.9 |
>=3.6 , <=3.9 |
1.7 |
0.8 |
>=3.6 , <=3.9 |
1.6 |
0.7 |
>=3.6 , <=3.8 |
1.5 |
0.6 |
>=3.5 , <=3.8 |
1.4 |
0.5 |
==2.7 , >=3.5 , <=3.8 |
1.3 |
0.4.2 / 0.4.3 |
==2.7 , >=3.5 , <=3.7 |
1.2 |
0.4.1 |
==2.7 , >=3.5 , <=3.7 |
1.1 |
0.3 |
==2.7 , >=3.5 , <=3.7 |
<=1.0 |
0.2 |
==2.7 , >=3.5 , <=3.7 |
2. python与torch对应版本安装
环境:- Vmware Ubuntu16.04 or Ubuntu20.04 – Anaconda python=3.8
1.torch1.13+cpu 版本
2.torch1.13+cuda 版本
# torch1.13+cpu 版本
pip install torch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 --index-url https://download.pytorch.org/whl/cpu
https://download.pytorch.org/whl/cpu为torch1.13.1+cpu版本
https://download.pytorch.org/whl/cu116为torch1.13.1+cuda116版本
二、torch_geometric安装
PyG官网安装
1. torch_geometric可选依赖包安装
环境:- Vmware Ubuntu16.04 or Ubuntu20.04 – Anaconda python=3.8
1.torch1.13+cpu 版本
2.torch1.13+cuda 版本
# Optional dependencies:
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-1.13.1%2Bcpu.html
https://data.pyg.org/whl/torch-1.13.1%2Bcpu.html为torch1.13.1+cpu版本对应的torch_geometric依赖包。
https://data.pyg.org/whl/torch-1.13.1%2Bcu116.html为torch1.13.1+cuda11.6版本对应的torch_geometric依赖包。
其他torch对应版本可在https://data.pyg.org/whl中寻找。
2. torch_geometric安装
pip install torch_geometric
作者:zzNanyou.