windows下安装nvidia apex教程!实测通过!!!

1. 安装pytorch 1.5

2. 修改:(根据自己的实际路径) /anaconda3/lib/site-packages/torch/include/torch/csrc/jit/api/module.h (474, 487, 501, 514) from static constexpr to static const

3. 修改:(根据自己的实际路径)/anaconda3/lib/site-packages/torch/include/pybind11/cast.h (1449) from explicit operator type&() { return *(this->value); } to explicit operator type&() { return *((type*)(this->value)); } 

4. 安装VS 2019 community

5. 克隆 https://github.com/kezewang/apex 到本地

6. 修改 setup.py (104行) to version_dependent_macros = version_ge_1_1 + version_ge_1_3 + version_ge_1_5 + ['-D_ENABLE_EXTENDED_ALIGNED_STORAGE']

7. 命令行下执行一下:

set CMAKE_GENERATOR=Visual Studio 16 2019
set CMAKE_GENERATOR_TOOLSET_VERSION=14.26
set DISTUTILS_USE_SDK=1
for /f "

你可能感兴趣的:(pytorch,C++,nvidia,深度学习,pytorch)