在x86_64架构下,官方torch包使用MKL加速库。如果需要使用其他blas和lapack加速库(如openblas)来提升性能,请使用源码编译安装方式安装官方torch包,步骤请参考PyTorch官方链接。
方式一:
pip3 install torch==1.11.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip3 install torch==2.0.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip3 install torch==2.1.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
方式二:
PyTorch版本 |
Python版本 |
下载链接 |
---|---|---|
1.11.0 |
Python 3.7和Python 3.7m |
https://download.pytorch.org/whl/cpu/torch-1.11.0%2Bcpu-cp37-cp37m-linux_x86_64.whl |
Python 3.8 |
https://download.pytorch.org/whl/cpu/torch-1.11.0%2Bcpu-cp38-cp38-linux_x86_64.whl |
|
Python 3.9 |
https://download.pytorch.org/whl/cpu/torch-1.11.0%2Bcpu-cp39-cp39-linux_x86_64.whl |
|
Python 3.10 |
https://download.pytorch.org/whl/cpu/torch-1.11.0%2Bcpu-cp310-cp310-linux_x86_64.whl |
|
2.0.1 |
Python 3.8 |
https://download.pytorch.org/whl/cpu/torch-2.0.1%2Bcpu-cp38-cp38-linux_x86_64.whl |
Python 3.9 |
https://download.pytorch.org/whl/cpu/torch-2.0.1%2Bcpu-cp39-cp39-linux_x86_64.whl |
|
Python 3.10 |
https://download.pytorch.org/whl/cpu/torch-2.0.1%2Bcpu-cp310-cp310-linux_x86_64.whl |
|
2.1.0 |
Python 3.8 |
https://download.pytorch.org/whl/cpu/torch-2.1.0%2Bcpu-cp38-cp38-linux_x86_64.whl |
Python 3.9 |
https://download.pytorch.org/whl/cpu/torch-2.1.0%2Bcpu-cp39-cp39-linux_x86_64.whl |
|
Python 3.10 |
https://download.pytorch.org/whl/cpu/torch-2.1.0%2Bcpu-cp310-cp310-linux_x86_64.whl |
pip3 install torch-1.11.0+cpu-cp38-cp38-linux_x86_64.whl
如果使用非root用户安装,需要在命令后加--user。
PyTorch版本 |
Python版本 |
下载链接 |
---|---|---|
1.11.0 |
Python 3.7和Python 3.7m |
https://download.pytorch.org/whl/torch-1.11.0-cp37-cp37m-manylinux2014_aarch64.whl |
Python 3.8 |
https://download.pytorch.org/whl/torch-1.11.0-cp38-cp38-manylinux2014_aarch64.whl |
|
Python 3.9 |
https://download.pytorch.org/whl/torch-1.11.0-cp39-cp39-manylinux2014_aarch64.whl |
|
Python 3.10 |
https://download.pytorch.org/whl/torch-1.11.0-cp310-cp310-manylinux2014_aarch64.whl |
|
2.0.1 |
Python 3.8 |
https://download.pytorch.org/whl/torch-2.0.1-cp38-cp38-manylinux2014_aarch64.whl |
Python 3.9 |
https://download.pytorch.org/whl/torch-2.0.1-cp39-cp39-manylinux2014_aarch64.whl |
|
Python 3.10 |
https://download.pytorch.org/whl/torch-2.0.1-cp310-cp310-manylinux2014_aarch64.whl |
|
2.1.0 |
Python 3.8 |
https://download.pytorch.org/whl/cpu/torch-2.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
Python 3.9 |
https://download.pytorch.org/whl/cpu/torch-2.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|
Python 3.10 |
https://download.pytorch.org/whl/cpu/torch-2.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
wget https://download.pytorch.org/whl/torch-1.11.0-cp38-cp38-manylinux2014_aarch64.whl
pip3 install torch-1.11.0-cp38-cp38-manylinux2014_aarch64.whl
如果使用非root用户安装,需要在命令后加--user。