之前都在服务器上跑pytorch,近来发现新版本可在windows上跑了,甚是开心。
环境: windows7 python3 无CPU
步骤:
1.
确保
确保python版本在
3.5.3/3.6.2
及以上版本,更新时只需下载所需的python setup exe,会有更新提示,无需
2. 到pytorch官网 https://pytorch.org/ 按照指令安装:

3. 如果import torch 无错,安装即完成
报错:
出现:
import torch
File "C:\Anaconda3\lib\site-packages\torch\__init__.py", line 41, in <module>
from torch._C import *
ImportError: DLL load failed: The specified module could not be found.
解决方案: (转自:
https://github.com/pytorch/pytorch/issues/4518 )
2. 下载
Intel openmp
: https://anaconda.org/anaconda/intel-openmp/files 下载 win-64/intel-openmp-2018.0.0-8.tar.bz2 并解压,将解压后得到的Library\bin添加到系统环境变量下
3. 重启