2021-03-20

win10+CUDA11.1 + python3.7 + pytorch1.7 安装DCNv2

1, 下载 PyTorch1.7的源码: https://github.com/lbin/DCNv2/tree/pytorch_1.7

2,将源码“Pycharm\Anaconda\Lib\site-packages\torch\utils\cpp_extension.py”中compiler_info.decode().strip()修改成compiler_info.decode(‘gbk’).strip() (不修改也能编译通过,都会提示“Pycharm\Anaconda\lib\site-packages\torch\utils\cpp_extension.py:287: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error)))”,

 源码command = [‘ninja’, ‘-v’]保持不变(此处注意要保持不变,改成‘--v’反而编译不通过)

3,运行python setup.py build develop,显示如下信息则编译成功:

copying build\lib.win-amd64-3.8\_ext.cp38-win_amd64.pyd -> 
Creating d:\pycharm\anaconda\lib\site-packages\DCNv2.egg-link (link to .)
DCNv2 0.1 is already the active version in easy-install.pth

Installed d:\test\downprj\sr\dcnv2-pytorch_1.7\dcnv2-pytorch_1.7
Processing dependencies for DCNv2==0.1
Finished processing dependencies for DCNv2==0.1

参考:

日常填坑-DCNv2+pytorch1.7+vs2017编译

CUDA10.1 + python3.7 + pytorch1.7 安装DCNv2

你可能感兴趣的:(深度学习,深度学习)