longcw / RoIAlign.pytorch

RoIAlign & crop_and_resize for PyTorch
555 stars 103 forks source link

crop_and_resize.obj : error LNK2001: unresolved external symbol __imp_THFloatTensor_zero #37

Open Yinhance opened 4 years ago

Yinhance commented 4 years ago

When I run install.sh ,the error occured. I found the error came when I run build.py

Creating library .\Release_crop_and_resize.lib and object .\Release_crop_and_resize.exp crop_and_resize.obj : error LNK2001: unresolved external symbol imp_THFloatTensor_zero crop_and_resize.obj : error LNK2001: unresolved external symbol imp_THFloatTensor_data crop_and_resize.obj : error LNK2001: unresolved external symbol imp_THFloatTensor_resize4d crop_and_resize.obj : error LNK2001: unresolved external symbol imp_THFloatTensor_size crop_and_resize.obj : error LNK2001: unresolved external symbol __imp_THIntTensor_data ._crop_and_resize.pyd : fatal error LNK1120: 5 unresolved externals Traceback (most recent call last): File "D:\Anaconda\lib\distutils_msvccompiler.py", line 520, in link self.spawn([self.linker] + ld_args) File "D:\Anaconda\lib\distutils_msvccompiler.py", line 543, in spawn return super().spawn(cmd) File "D:\Anaconda\lib\distutils\ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "D:\Anaconda\lib\distutils\spawn.py", line 38, in spawn _spawn_nt(cmd, search_path, dry_run=dry_run) File "D:\Anaconda\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\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\link.exe' failed with exit status 1120

During handling of the above exception, another exception occurred:

Traceback (most recent call last): 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 985, in run_command cmd_obj.run() File "D:\Anaconda\lib\site-packages\setuptools\command\build_ext.py", line 84, 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 340, in run self.build_extensions() File "D:\Anaconda\lib\site-packages\Cython\Distutils\old_build_ext.py", line 194, in build_extensions self.build_extension(ext) File "D:\Anaconda\lib\site-packages\setuptools\command\build_ext.py", line 205, in build_extension _build_ext.build_extension(self, ext) File "D:\Anaconda\lib\distutils\command\build_ext.py", line 559, in build_extension target_lang=language) File "D:\Anaconda\lib\distutils\ccompiler.py", line 717, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File "D:\Anaconda\lib\distutils_msvccompiler.py", line 523, in link raise LinkError(msg) distutils.errors.LinkError: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\link.exe' failed with exit status 1120

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:/Users/%user%/Desktop/graduatio_project/Group-Activity-Recognition-master/RoIAlign.pytorch-pytorch_0.4/roi_align/build.py", line 40, in ffi.build() File "D:\Anaconda\lib\site-packages\torch\utils\ffi__init.py", line 189, in build _build_extension(ffi, cffi_wrapper_name, target_dir, verbose) File "D:\Anaconda\lib\site-packages\torch\utils\ffi__init__.py", line 111, in _build_extension outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname) File "D:\Anaconda\lib\site-packages\cffi\api.py", line 723, in compile compiler_verbose=verbose, debug=debug, **kwds) File "D:\Anaconda\lib\site-packages\cffi\recompiler.py", line 1526, 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 58, in _build raise VerificationError('%s: %s' % (e.class.name__, e)) cffi.VerificationError: LinkError: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\link.exe' failed with exit status 1120

Can anyone tell me how to solve this problem? Thx a lot!!!