一,pytorch的官网:
https://pytorch.org/ 如图:![](/i/l/?n=22&i=blog/1938691/202210/1938691-20221013170220763-2024884777.png)
说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest
对应的源码可以访问这里获取: https://github.com/liuhongdi/
或: https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: [email protected]
二,从命令行安装:
[lhdop@blog ~]$ pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu Defaulting to user installation because normal site-packages is not writeable Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cpu Requirement already satisfied: torch in ./.local/lib/python3.6/site-packages (1.10.1) Requirement already satisfied: torchvision in ./.local/lib/python3.6/site-packages (0.11.2) Collecting torchaudio Downloading https://download.pytorch.org/whl/cpu/torchaudio-0.10.2%2Bcpu-cp36-cp36m-linux_x86_64.whl (2.7 MB) |████████████████████████████████| 2.7 MB 546 kB/s Requirement already satisfied: typing-extensions in ./.local/lib/python3.6/site-packages (from torch) (4.1.1) Requirement already satisfied: dataclasses in ./.local/lib/python3.6/site-packages (from torch) (0.8) Requirement already satisfied: numpy in ./.local/lib/python3.6/site-packages (from torchvision) (1.19.5) Requirement already satisfied: pillow!=8.3.0,>=5.3.0 in ./.local/lib/python3.6/site-packages (from torchvision) (8.1.1) Downloading https://download.pytorch.org/whl/cpu/torchaudio-0.10.1%2Bcpu-cp36-cp36m-linux_x86_64.whl (2.7 MB) |████████████████████████████████| 2.7 MB 826 kB/s Installing collected packages: torchaudio Successfully installed torchaudio-0.10.1+cpu
三,查看已安装的pytorch的版本:
[lhdop@blog ~]$ python3 Python 3.6.8 (default, Oct 7 2019, 17:58:22) [GCC 8.2.1 20180905 (Red Hat 8.2.1-3)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import torch >>> torch.__version__ '1.10.1+cu102' >>> >>>如图:
![](/i/l/?n=22&i=blog/1938691/202210/1938691-20221013170220692-816368001.png)
四,查看python和pip的版本:
查看python的版本:[lhdop@blog ~]$ python3 --version Python 3.6.8
查看pip的版本:
[lhdop@blog ~]$ python3 -m pip show pip Name: pip Version: 21.3.1 Summary: The PyPA recommended tool for installing Python packages. Home-page: https://pip.pypa.io/ Author: The pip developers Author-email: [email protected] License: MIT Location: /usr/local/lib/python3.6/site-packages Requires: Required-by:
标签:1.10,cu102,site,python3.6,pytorch,https,packages,local From: https://www.cnblogs.com/architectforest/p/16788804.html