本人电脑上安装了vs2015,cuda9.0+1060显卡,python3.6,系统win10,框架是mxnet以及pytorch0.4版本,近日在跑github上的faster-rcnn的程序时,发现在build cython模块时出现下面错误,网上似乎没有类似情况,希望有大神碰到类似情况的能帮帮我。
Traceback (most recent call last):
File "build.py", line 34, in <module>
ffi.build()
File "D:\anaconda\lib\site-packages\torch\utils\ffi\__init__.py", line 184, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "D:\anaconda\lib\site-packages\torch\utils\ffi\__init__.py", line 108, in _build_extension
outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "D:\anaconda\lib\site-packages\cffi\api.py", line 697, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "D:\anaconda\lib\site-packages\cffi\recompiler.py", line 1520, in recompile
compiler_verbose, debug)
File "D:\anaconda\lib\site-packages\cffi\ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "D:\anaconda\lib\site-packages\cffi\ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "D:\anaconda\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "D:\anaconda\lib\site-packages\setuptools\command\build_ext.py", line 78, in run
_build_ext.run(self)
File "D:\anaconda\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "D:\anaconda\lib\distutils\command\build_ext.py", line 308, in run
force=self.force)
File "D:\anaconda\lib\distutils\ccompiler.py", line 1031, in new_compiler
return klass(None, dry_run, force)
File "D:\anaconda\lib\distutils\cygwinccompiler.py", line 285, in __init__
CygwinCCompiler.__init__ (self, verbose, dry_run, force)
File "D:\anaconda\lib\distutils\cygwinccompiler.py", line 129, in __init__
if self.ld_version >= "2.10.90":
TypeError: '>=' not supported between instances of 'NoneType' and 'str'
后来我又试了试用gcc编译器,但是仍然存在一下问题(实在是没办法了。。。)
C:\MinGW\bin\g++.exe --shared -s build\temp.win-amd64-3.6\Release\gpu_nms.o build\temp.win-amd64-3.6\Release\gpu_nms.cp36-win_amd64.def -LD:\anaconda\libs -LD:\anaconda\PCbuild\amd64 -lcublas -lpython36 -lmsvcr140 -o build\lib.win-amd64-3.6\gpu_nms.cp36-win_amd64.pyd
build\temp.win-amd64-3.6\Release\gpu_nms.o: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
error: command 'C:\\MinGW\\bin\\g++.exe' failed with exit status 1