BasicSR
BasicSR copied to clipboard
LINK : fatal error LNK1181 or ImportError: No module named 'deform_conv'
os:win11 gpu:rtx2070s cuda:10.1 torch:1.7.1 python:3.7.9 先是fused_act_ext报错,然后在环境变量里加了BASICSR_EXT=True和BASICSR_JIT=True 执行pip install basicsr -vvv能安装成功,但是会报错No module named 'deform_conv' 在issues280发现也有人这样,尝试python setup.py develop安装报错如下:(之前报错是 Command '['ninja', '-v']' returned non-zero exit status 1,后来把-v改成--version算是过去了)
python setup.py develop D:\PythonProject\Img_relighting\venv\lib\site-packages\setuptools_init_.py:151: SetuptoolsDeprecationWarning: setup_requires is deprecated. Supply build dependencies using PEP 517 pyproject.toml build-requires. SetuptoolsDeprecationWarning, running develop D:\PythonProject\Img_relighting\venv\lib\site-packages\setuptools\command\easy_install.py:159: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. EasyInstallDeprecationWarning, D:\PythonProject\Img_relighting\venv\lib\site-packages\setuptools\command\install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. setuptools.SetuptoolsDeprecationWarning, running egg_info writing basicsr.egg-info\PKG-INFO writing dependency_links to basicsr.egg-info\dependency_links.txt writing requirements to basicsr.egg-info\requires.txt writing top-level names to basicsr.egg-info\top_level.txt reading manifest file 'basicsr.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'basicsr.egg-info\SOURCES.txt' running build_ext D:\PythonProject\Img_relighting\venv\lib\site-packages\torch\utils\cpp_extension.py:287: UserWarning: Error checking compiler version for cl: 'utf-8' codec can't decode byte 0xd3 in position 0: invalid continuation byte warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error)) building 'basicsr.ops.dcn.deform_conv_ext' extension Emitting ninja build file D:\PythonProject\StyleGAN\GFPGAN\BasicSR-master\build\temp.win-amd64-3.7\Release\build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) 1.10.2.git.kitware.jobserver-1 D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:D:\PythonProject\Img_relighting\venv\lib
site-packages\torch\lib "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\lib/x64" /LIBPATH:D:\PythonProject\Img_relighting\venv\libs "/LIBPATH:D:\Program Files\Python37\libs" "/LIBPATH:D:\Program Files\Python37" /LIBP ATH:D:\PythonProject\Img_relighting\venv\PCbuild\amd64 "/LIBPATH:D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\lib\x64" "/LIBPATH:D:\Program Files (x86)\Microsoft Visual Studio\2019\Comm unity\VC\Tools\MSVC\14.28.29333\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\lib\um\x64" "/LIBPATH:D:\Windows Kits\10\lib\10.0.18362.0\ucrt\x64" "/LIBPATH:D:\Windows Kits\10\lib\10.0.18362.0\um\x64" "/LIBPATH:D :\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\lib\x64" "/LIBPATH:D:\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86" "/LIBPATH:D:\Windows Kits\10\Lib\10.0.18362.0\um\x86" c10.lib torch.lib torch_cpu.l ib torch_python.lib cudart.lib c10_cuda.lib torch_cuda.lib /EXPORT:PyInit_deform_conv_ext D:\PythonProject\StyleGAN\GFPGAN\BasicSR-master\build\temp.win-amd64-3.7\Release\basicsr\ops\dcn\src/deform_conv_ext.obj D:\PythonProject\StyleGA N\GFPGAN\BasicSR-master\build\temp.win-amd64-3.7\Release\basicsr\ops\dcn\src/deform_conv_cuda.obj D:\PythonProject\StyleGAN\GFPGAN\BasicSR-master\build\temp.win-amd64-3.7\Release\basicsr\ops\dcn\src/deform_conv_cuda_kernel.obj /OUT:bui ld\lib.win-amd64-3.7\basicsr\ops\dcn\deform_conv_ext.cp37-win_amd64.pyd /IMPLIB:D:\PythonProject\StyleGAN\GFPGAN\BasicSR-master\build\temp.win-amd64-3.7\Release\basicsr\ops\dcn\src\deform_conv_ext.cp37-win_amd64.lib 正在创建库 D:\PythonProject\StyleGAN\GFPGAN\BasicSR-master\build\temp.win-amd64-3.7\Release\basicsr\ops\dcn\src\deform_conv_ext.cp37-win_amd64.lib 和对象 D:\PythonProject\StyleGAN\GFPGAN\BasicSR-master\build\temp.win-amd64-3.7\Releas e\basicsr\ops\dcn\src\deform_conv_ext.cp37-win_amd64.exp 正在生成代码 已完成代码的生成 building 'basicsr.ops.fused_act.fused_act_ext' extension Emitting ninja build file D:\PythonProject\StyleGAN\GFPGAN\BasicSR-master\build\temp.win-amd64-3.7\Release\build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) 1.10.2.git.kitware.jobserver-1 D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:D:\PythonProject\Img_relighting\venv\lib
site-packages\torch\lib "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\lib/x64" /LIBPATH:D:\PythonProject\Img_relighting\venv\libs "/LIBPATH:D:\Program Files\Python37\libs" "/LIBPATH:D:\Program Files\Python37" /LIBP ATH:D:\PythonProject\Img_relighting\venv\PCbuild\amd64 "/LIBPATH:D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\lib\x64" "/LIBPATH:D:\Program Files (x86)\Microsoft Visual Studio\2019\Comm unity\VC\Tools\MSVC\14.28.29333\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\lib\um\x64" "/LIBPATH:D:\Windows Kits\10\lib\10.0.18362.0\ucrt\x64" "/LIBPATH:D:\Windows Kits\10\lib\10.0.18362.0\um\x64" "/LIBPATH:D :\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\lib\x64" "/LIBPATH:D:\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86" "/LIBPATH:D:\Windows Kits\10\Lib\10.0.18362.0\um\x86" c10.lib torch.lib torch_cpu.l ib torch_python.lib cudart.lib c10_cuda.lib torch_cuda.lib /EXPORT:PyInit_fused_act_ext D:\PythonProject\StyleGAN\GFPGAN\BasicSR-master\build\temp.win-amd64-3.7\Release\basicsr\ops\fused_act\src/fused_bias_act.obj D:\PythonProject\Styl eGAN\GFPGAN\BasicSR-master\build\temp.win-amd64-3.7\Release\basicsr\ops\fused_act\src/fused_bias_act_kernel.obj /OUT:build\lib.win-amd64-3.7\basicsr\ops\fused_act\fused_act_ext.cp37-win_amd64.pyd /IMPLIB:D:\PythonProject\StyleGAN\GFPGA N\BasicSR-master\build\temp.win-amd64-3.7\Release\basicsr\ops\fused_act\src\fused_act_ext.cp37-win_amd64.lib LINK : fatal error LNK1181: 无法打开输入文件“D:\PythonProject\StyleGAN\GFPGAN\BasicSR-master\build\temp.win-amd64-3.7\Release\basicsr\ops\fused_act\src\fused_bias_act_kernel.obj” error: command 'D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\link.exe' failed with exit status 1181
然后找了http://github.tbz.io/Blog/17/04/CL_CL_VS17.html 尝试配置cl,cmd里确实登录cl了,但也没能解决上面的问题,遂求助。 感谢回复! 自己的需求是想跑stylegan2的infer和train
I also have this problem. Have you solved it? I have it configured on Ubuntu, but i want to configure it on Windows @a656418zz
I also have this problem. Have people solved it?
maybe need to install some dependency before you run the setup script have a look here: https://github.com/xinntao/BasicSR/pull/514