安装
安装还得看 官网
找到这个界面

复制命令即可
如果想装 其他版本,点击 https://pytorch.org/get-started/previous-versions/
或者 https://pytorch.org/get-started/locally/
检测是否安装成功
看看 gpu 版的
import torch
torch.__version__ torch.cuda.is_available()
异常记录
报如下异常
Error loading "C:\Python\lib\site-packages\torch\lib\asmjit.dll" or one of its dependencies
最简单的办法是降低版本,如
pip install torch==1.5.1+cpu torchvision==0.6.1+cpu
其他解决办法见 参考资料
参考资料:
https://blog.csdn.net/weixin_45733462/article/details/109119607 安装
https://www.cnblogs.com/andrew-address/p/12733669.html 安装
https://www.cnblogs.com/yz-lucky77/p/13839724.html 异常1更多解决办法
浙公网安备 33010602011771号