环境说明
软件 | 版本 |
---|---|
os | win10 |
python | 3.6 |
pytorch | 1.1.0 |
cuda | 9.2 |
问题
https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html
步骤是按照上面链接中来的,但是在执行 $ pip install torch-scatter
的时候安装失败。
报错为:
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2 failed building wheel for torch scatter
解决方案
查阅了一些资料,可能是CUDA、VS的版本的一些问题。
- 找到
CUDA\v9.2\include\crt\host_config.h
一般是c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include\crt\host_config.h
- 找到
#if _MSC_VER < 1600 || _MSC_VER > 1913 3
这行代码,修改为#if _MSC_VER < 1600
- 再一次进行
pip intall torch-scatter
即可 - 安装成功截图
参考链接
issues with installation of torch-scatter
Cuda 9.2 does NOT work with Visual Studio 2017 15.7.1