jwyang / faster-rcnn.pytorch

A faster pytorch implementation of faster r-cnn
MIT License
7.69k stars 2.33k forks source link

Can I complete the compilation under Windows? #875

Open life97 opened 2 years ago

life97 commented 2 years ago

Can I compile under Windows server2016 system? Since the laboratory servers are all based on Windows systems, it is impractical to replace the system. At present, the compilation cannot be successful when running sh make.sh. Ask all colleagues how to successfully complete the compilation? I would be very grateful if you could tell me. Windows server2016 ,pytorch 0.4.1 ,cuda 9.0 ,visual studio 2017 My error is as follows: running build_ext Traceback (most recent call last): File "setup.py", line 135, in cmdclass={'build_ext': custom_build_ext}, File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\core.py", line 148, in setup dist.run_commands() File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\dist.py", line 955, in run_commands self.run_command(cmd) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\dist.py", line 974, in run_command cmd_obj.run() File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run _build_ext.build_ext.run(self) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 339, in run self.build_extensions() File "setup.py", line 111, in build_extensions customize_compiler_for_nvcc(self.compiler) File "setup.py", line 83, in customize_compiler_for_nvcc default_compiler_so = self.compiler_so AttributeError: 'MSVCCompiler' object has no attribute 'compiler_so' Compiling nms kernels by nvcc... nms_cuda_kernel.cu cl: 命令行 warning D9002 :忽略未知选项“-fPIC” nms_cuda_kernel.cu c:\program files\nvidia gpu computing toolkit\cuda\v9.0\include\crt/host_config.h(133): fatal error C1189: #error: -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported! Including CUDA code. H:\19xyy\project\GPA-detection-master\lib\model\nms ['H:\19xyy\project\GPA-detection-master\lib\model\nms\src/nms_cuda_kernel.cu.o'] generating C:\Users\ADMINI~1\AppData\Local\Temp\2\tmp2685w29y_nms.c setting the current directory to 'C:\Users\ADMINI~1\AppData\Local\Temp\2\tmp2685w29y' running build_ext building '_nms' extension creating Release creating Release\19xyy creating Release\19xyy\project creating Release\19xyy\project\GPA-detection-master creating Release\19xyy\project\GPA-detection-master\lib creating Release\19xyy\project\GPA-detection-master\lib\model creating Release\19xyy\project\GPA-detection-master\lib\model\nms creating Release\19xyy\project\GPA-detection-master\lib\model\nms\src C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWITH_CUDA -IG:\Anaconda3\envs\xyy_gpa\l ib\site-packages\torch\utils\ffi....\lib\include -IG:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\utils\ffi....\lib\include\TH -IG:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\ut ils\ffi....\lib\include\THC "-IC:\Program Files\NVIDIA Corporation\NvToolsExt\/include" -IG:\Anaconda3\envs\xyy_gpa\include -IG:\Anaconda3\envs\xyy_gpa\include "-IC:\Program Files (x86)\ Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\P rogram Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763 .0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\1 0\include\10.0.17763.0\cppwinrt" /Tc_nms.c /Fo.\Release_nms.obj -std=c99 cl: 命令行 warning D9002 :忽略未知选项“-std=c99” _nms.c g:\anaconda3\envs\xyy_gpa\lib\site-packages\torch\lib\include\thc\THCGeneral.h(12): fatal error C1083: 无法打开包括文件: “cuda.h”: No such file or directory Traceback (most recent call last): File "G:\Anaconda3\envs\xyy_gpa\lib\distutils_msvccompiler.py", line 423, in compile self.spawn(args) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils_msvccompiler.py", line 542, in spawn return super().spawn(cmd) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\spawn.py", line 38, in spawn _spawn_nt(cmd, search_path, dry_run=dry_run) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\spawn.py", line 81, in _spawn_nt "command %r failed with exit status %d" % (cmd, rc)) distutils.errors.DistutilsExecError: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit s tatus 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\ffiplatform.py", line 51, in _build dist.run_command('build_ext') File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\dist.py", line 974, in run_command cmd_obj.run() File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\setuptools\command\build_ext.py", line 79, in run _build_ext.run(self) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run _build_ext.build_ext.run(self) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 339, in run self.build_extensions() File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions _build_ext.build_ext.build_extensions(self) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 448, in build_extensions self._build_extensions_serial() File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial self.build_extension(ext) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\setuptools\command\build_ext.py", line 202, in build_extension _build_ext.build_extension(self, ext) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 533, in build_extension depends=ext.depends) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils_msvccompiler.py", line 425, in compile raise CompileError(msg) distutils.errors.CompileError: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit status 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "build.py", line 37, in ffi.build() File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\utils\ffi__init.py", line 189, in build _build_extension(ffi, cffi_wrapper_name, target_dir, verbose) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\utils\ffi__init__.py", line 111, in _build_extension outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\api.py", line 727, in compile compiler_verbose=verbose, debug=debug, **kwds) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\recompiler.py", line 1565, in recompile compiler_verbose, debug) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\ffiplatform.py", line 22, in compile outputfilename = _build(tmpdir, ext, compiler_verbose, debug) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\ffiplatform.py", line 58, in _build raise VerificationError('%s: %s' % (e.class.name__, e)) cffi.VerificationError: CompileError: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit status 2 Compiling roi pooling kernels by nvcc... roi_pooling_kernel.cu cl: 命令行 warning D9002 :忽略未知选项“-fPIC” roi_pooling_kernel.cu c:\program files\nvidia gpu computing toolkit\cuda\v9.0\include\crt/host_config.h(133): fatal error C1189: #error: -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported! H:\19xyy\project\GPA-detection-master\lib\model\roi_pooling Including CUDA code. generating C:\Users\ADMINI~1\AppData\Local\Temp\2\tmpk1104ho1_roi_pooling.c setting the current directory to 'C:\Users\ADMINI~1\AppData\Local\Temp\2\tmpk1104ho1' running build_ext building '_roi_pooling' extension creating Release creating Release\19xyy creating Release\19xyy\project creating Release\19xyy\project\GPA-detection-master creating Release\19xyy\project\GPA-detection-master\lib creating Release\19xyy\project\GPA-detection-master\lib\model creating Release\19xyy\project\GPA-detection-master\lib\model\roi_pooling creating Release\19xyy\project\GPA-detection-master\lib\model\roi_pooling\src C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWITH_CUDA -IG:\Anaconda3\envs\xyy_gpa\l ib\site-packages\torch\utils\ffi....\lib\include -IG:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\utils\ffi....\lib\include\TH -IG:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\ut ils\ffi....\lib\include\THC "-IC:\Program Files\NVIDIA Corporation\NvToolsExt\/include" -IG:\Anaconda3\envs\xyy_gpa\include -IG:\Anaconda3\envs\xyy_gpa\include "-IC:\Program Files (x86)\ Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\P rogram Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763 .0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\1 0\include\10.0.17763.0\cppwinrt" /Tc_roi_pooling.c /Fo.\Release_roi_pooling.obj -std=c99 cl: 命令行 warning D9002 :忽略未知选项“-std=c99” _roi_pooling.c g:\anaconda3\envs\xyy_gpa\lib\site-packages\torch\lib\include\thc\THCGeneral.h(12): fatal error C1083: 无法打开包括文件: “cuda.h”: No such file or directory Traceback (most recent call last): File "G:\Anaconda3\envs\xyy_gpa\lib\distutils_msvccompiler.py", line 423, in compile self.spawn(args) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils_msvccompiler.py", line 542, in spawn return super().spawn(cmd) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\spawn.py", line 38, in spawn _spawn_nt(cmd, search_path, dry_run=dry_run) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\spawn.py", line 81, in _spawn_nt "command %r failed with exit status %d" % (cmd, rc)) distutils.errors.DistutilsExecError: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit s tatus 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\ffiplatform.py", line 51, in _build dist.run_command('build_ext') File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\dist.py", line 974, in run_command cmd_obj.run() File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\setuptools\command\build_ext.py", line 79, in run _build_ext.run(self) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run _build_ext.build_ext.run(self) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 339, in run self.build_extensions() File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions _build_ext.build_ext.build_extensions(self) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 448, in build_extensions self._build_extensions_serial() File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial self.build_extension(ext) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\setuptools\command\build_ext.py", line 202, in build_extension _build_ext.build_extension(self, ext) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 533, in build_extension depends=ext.depends) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils_msvccompiler.py", line 425, in compile raise CompileError(msg) distutils.errors.CompileError: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit status 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "build.py", line 36, in ffi.build() File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\utils\ffi__init.py", line 189, in build _build_extension(ffi, cffi_wrapper_name, target_dir, verbose) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\utils\ffi__init__.py", line 111, in _build_extension outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\api.py", line 727, in compile compiler_verbose=verbose, debug=debug, **kwds) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\recompiler.py", line 1565, in recompile compiler_verbose, debug) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\ffiplatform.py", line 22, in compile outputfilename = _build(tmpdir, ext, compiler_verbose, debug) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\ffiplatform.py", line 58, in _build raise VerificationError('%s: %s' % (e.class.name__, e)) cffi.VerificationError: CompileError: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit status 2 Compiling roi align kernels by nvcc... roi_align_kernel.cu cl: 命令行 warning D9002 :忽略未知选项“-fPIC” roi_align_kernel.cu c:\program files\nvidia gpu computing toolkit\cuda\v9.0\include\crt/host_config.h(133): fatal error C1189: #error: -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported! H:\19xyy\project\GPA-detection-master\lib\model\roi_align Including CUDA code. generating C:\Users\ADMINI~1\AppData\Local\Temp\2\tmphq3w_wdp_roi_align.c setting the current directory to 'C:\Users\ADMINI~1\AppData\Local\Temp\2\tmphq3w_wdp' running build_ext building '_roi_align' extension creating Release creating Release\19xyy creating Release\19xyy\project creating Release\19xyy\project\GPA-detection-master creating Release\19xyy\project\GPA-detection-master\lib creating Release\19xyy\project\GPA-detection-master\lib\model creating Release\19xyy\project\GPA-detection-master\lib\model\roi_align creating Release\19xyy\project\GPA-detection-master\lib\model\roi_align\src C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWITH_CUDA -IG:\Anaconda3\envs\xyy_gpa\l ib\site-packages\torch\utils\ffi....\lib\include -IG:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\utils\ffi....\lib\include\TH -IG:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\ut ils\ffi....\lib\include\THC "-IC:\Program Files\NVIDIA Corporation\NvToolsExt\/include" -IG:\Anaconda3\envs\xyy_gpa\include -IG:\Anaconda3\envs\xyy_gpa\include "-IC:\Program Files (x86)\ Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\P rogram Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763 .0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\1 0\include\10.0.17763.0\cppwinrt" /Tc_roi_align.c /Fo.\Release_roi_align.obj -std=c99 cl: 命令行 warning D9002 :忽略未知选项“-std=c99” _roi_align.c g:\anaconda3\envs\xyy_gpa\lib\site-packages\torch\lib\include\thc\THCGeneral.h(12): fatal error C1083: 无法打开包括文件: “cuda.h”: No such file or directory Traceback (most recent call last): File "G:\Anaconda3\envs\xyy_gpa\lib\distutils_msvccompiler.py", line 423, in compile self.spawn(args) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils_msvccompiler.py", line 542, in spawn return super().spawn(cmd) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\spawn.py", line 38, in spawn _spawn_nt(cmd, search_path, dry_run=dry_run) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\spawn.py", line 81, in _spawn_nt "command %r failed with exit status %d" % (cmd, rc)) distutils.errors.DistutilsExecError: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit s tatus 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\ffiplatform.py", line 51, in _build dist.run_command('build_ext') File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\dist.py", line 974, in run_command cmd_obj.run() File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\setuptools\command\build_ext.py", line 79, in run _build_ext.run(self) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run _build_ext.build_ext.run(self) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 339, in run self.build_extensions() File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions _build_ext.build_ext.build_extensions(self) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 448, in build_extensions self._build_extensions_serial() File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial self.build_extension(ext) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\setuptools\command\build_ext.py", line 202, in build_extension _build_ext.build_extension(self, ext) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 533, in build_extension depends=ext.depends) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils_msvccompiler.py", line 425, in compile raise CompileError(msg) distutils.errors.CompileError: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit status 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "build.py", line 38, in ffi.build() File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\utils\ffi__init.py", line 189, in build _build_extension(ffi, cffi_wrapper_name, target_dir, verbose) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\utils\ffi__init__.py", line 111, in _build_extension outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\api.py", line 727, in compile compiler_verbose=verbose, debug=debug, **kwds) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\recompiler.py", line 1565, in recompile compiler_verbose, debug) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\ffiplatform.py", line 22, in compile outputfilename = _build(tmpdir, ext, compiler_verbose, debug) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\ffiplatform.py", line 58, in _build raise VerificationError('%s: %s' % (e.class.name__, e)) cffi.VerificationError: CompileError: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit status 2 Compiling roi crop kernels by nvcc... roi_crop_cuda_kernel.cu cl: 命令行 warning D9002 :忽略未知选项“-fPIC” roi_crop_cuda_kernel.cu c:\program files\nvidia gpu computing toolkit\cuda\v9.0\include\crt/host_config.h(133): fatal error C1189: #error: -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported! Including CUDA code. H:\19xyy\project\GPA-detection-master\lib\model\roi_crop generating C:\Users\ADMINI~1\AppData\Local\Temp\2\tmp69evgia5_roi_crop.c setting the current directory to 'C:\Users\ADMINI~1\AppData\Local\Temp\2\tmp69evgia5' running build_ext building '_roi_crop' extension creating Release creating Release\19xyy creating Release\19xyy\project creating Release\19xyy\project\GPA-detection-master creating Release\19xyy\project\GPA-detection-master\lib creating Release\19xyy\project\GPA-detection-master\lib\model creating Release\19xyy\project\GPA-detection-master\lib\model\roi_crop creating Release\19xyy\project\GPA-detection-master\lib\model\roi_crop\src C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWITH_CUDA -IG:\Anaconda3\envs\xyy_gpa\l ib\site-packages\torch\utils\ffi....\lib\include -IG:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\utils\ffi....\lib\include\TH -IG:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\ut ils\ffi....\lib\include\THC "-IC:\Program Files\NVIDIA Corporation\NvToolsExt\/include" -IG:\Anaconda3\envs\xyy_gpa\include -IG:\Anaconda3\envs\xyy_gpa\include "-IC:\Program Files (x86)\ Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\P rogram Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763 .0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\1 0\include\10.0.17763.0\cppwinrt" /Tc_roi_crop.c /Fo.\Release_roi_crop.obj -std=c99 cl: 命令行 warning D9002 :忽略未知选项“-std=c99” _roi_crop.c g:\anaconda3\envs\xyy_gpa\lib\site-packages\torch\lib\include\thc\THCGeneral.h(12): fatal error C1083: 无法打开包括文件: “cuda.h”: No such file or directory Traceback (most recent call last): File "G:\Anaconda3\envs\xyy_gpa\lib\distutils_msvccompiler.py", line 423, in compile self.spawn(args) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils_msvccompiler.py", line 542, in spawn return super().spawn(cmd) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\spawn.py", line 38, in spawn _spawn_nt(cmd, search_path, dry_run=dry_run) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\spawn.py", line 81, in _spawn_nt "command %r failed with exit status %d" % (cmd, rc)) distutils.errors.DistutilsExecError: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit s tatus 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\ffiplatform.py", line 51, in _build dist.run_command('build_ext') File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\dist.py", line 974, in run_command cmd_obj.run() File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\setuptools\command\build_ext.py", line 79, in run _build_ext.run(self) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run _build_ext.build_ext.run(self) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 339, in run self.build_extensions() File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions _build_ext.build_ext.build_extensions(self) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 448, in build_extensions self._build_extensions_serial() File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial self.build_extension(ext) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\setuptools\command\build_ext.py", line 202, in build_extension _build_ext.build_extension(self, ext) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils\command\build_ext.py", line 533, in build_extension depends=ext.depends) File "G:\Anaconda3\envs\xyy_gpa\lib\distutils_msvccompiler.py", line 425, in compile raise CompileError(msg) distutils.errors.CompileError: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit status 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "build.py", line 36, in ffi.build() File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\utils\ffi__init.py", line 189, in build _build_extension(ffi, cffi_wrapper_name, target_dir, verbose) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\torch\utils\ffi__init__.py", line 111, in _build_extension outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\api.py", line 727, in compile compiler_verbose=verbose, debug=debug, **kwds) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\recompiler.py", line 1565, in recompile compiler_verbose, debug) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\ffiplatform.py", line 22, in compile outputfilename = _build(tmpdir, ext, compiler_verbose, debug) File "G:\Anaconda3\envs\xyy_gpa\lib\site-packages\cffi\ffiplatform.py", line 58, in _build raise VerificationError('%s: %s' % (e.class.name__, e)) cffi.VerificationError: CompileError: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit status 2

chenjshnn commented 1 year ago

did you fix it?