下载 Visual Studio Community Edition 2017
下载Python 2.7.14 (x86-64) 和 Microsoft Visual C++ Compiler for Python 2.7.
把 C:\Python27 and C:\Python27\scripts 加入到windows Path变量中。
下载下列依赖包
下载下列依赖包
pip install future ^
hypothesis ^
numpy ^
protobuf ^
six
hypothesis ^
numpy ^
protobuf ^
six
pip install flask ^
glog ^
graphviz ^
jupyter ^
matplotlib ^
pydot python-nvd3 ^
pyyaml ^
requests ^
scikit-image ^
scipy ^
setuptools ^
tornado
glog ^
graphviz ^
jupyter ^
matplotlib ^
pydot python-nvd3 ^
pyyaml ^
requests ^
scikit-image ^
scipy ^
setuptools ^
tornado
clone pytorch源码到本地。
git clone --recursive https://github.com/pytorch/pytorch.git
编辑 ‘\scripts\build_windows.bat’
找到其中的 set BUILD_PYTHON 设置为 ON
找到其中的 set BUILD_PYTHON 设置为 ON
运行Developer Command Prompt for VS 2017,
找到pytorch中\scripts文件夹,先在命令行中运行set CMAKE_GENERATOR="Visual Studio 15 2017 Win64" 将CAMKE编译器换成2017版本然后在命令行中输入
call build_windows.bat
最后在环境变量中加入PYTHONPATH这个环境变量
路径设置为pytorch\build 所在路径。大功告成
路径设置为pytorch\build 所在路径。大功告成