之前都在服務器上跑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. 重啟