rowanz/neural-motifs

Executing this project on windows

AleDella opened this issue · 0 comments

Hi! I've been trying to execute this project for using it to produce scene graphs from images; but on windows I have a lot of problems regarding the making of the C libraries both when using python 3.9 and python 3.6 (using conda and vscode). I tried downgrading the pytorch version until 0.4.0 but still I have problems with compiling the C libraries. In particular when trying to execute the lib/fnb/nms/build.py I get the error:

python build.py
Including CUDA code.
D:\Master Thesis\neural-motifs\lib\fpn\nms
generating C:\Users\aless\AppData\Local\Temp\tmp3e0wlr5j\_nms.c
setting the current directory to 'C:\\Users\\aless\\AppData\\Local\\Temp\\tmp3e0wlr5j'
running build_ext
building '_nms' extension
creating Release
creating Release\Master Thesis
creating Release\Master Thesis\neural-motifs
creating Release\Master Thesis\neural-motifs\lib
creating Release\Master Thesis\neural-motifs\lib\fpn
creating Release\Master Thesis\neural-motifs\lib\fpn\nms
creating Release\Master Thesis\neural-motifs\lib\fpn\nms\src
D:\VSShit\IDE\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWITH_CUDA -ID:\anaconda\envs\neural-motifs\lib\site-packages\torch\utils\ffi\..\..\lib\include -ID:\anaconda\envs\neural-motifs\lib\site-packages\torch\utils\ffi\..\..\lib\include\TH -ID:\anaconda\envs\neural-motifs\lib\site-packages\torch\utils\ffi\..\..\lib\include\THC -ID:\Cuda/include "-IC:\Program Files\NVIDIA Corporation\NvToolsExt\/include" -ID:\anaconda\envs\neural-motifs\include -ID:\anaconda\envs\neural-motifs\include -ID:\VSShit\IDE\VC\Tools\MSVC\14.29.30133\include "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tc_nms.c /Fo.\Release\_nms.obj
_nms.c
D:\VSShit\IDE\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWITH_CUDA -ID:\anaconda\envs\neural-motifs\lib\site-packages\torch\utils\ffi\..\..\lib\include -ID:\anaconda\envs\neural-motifs\lib\site-packages\torch\utils\ffi\..\..\lib\include\TH -ID:\anaconda\envs\neural-motifs\lib\site-packages\torch\utils\ffi\..\..\lib\include\THC -ID:\Cuda/include "-IC:\Program Files\NVIDIA Corporation\NvToolsExt\/include" -ID:\anaconda\envs\neural-motifs\include -ID:\anaconda\envs\neural-motifs\include -ID:\VSShit\IDE\VC\Tools\MSVC\14.29.30133\include "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" "/TcD:\Master Thesis\neural-motifs\lib\fpn\nms\src\nms_cuda.c" "/Fo.\Release\Master Thesis\neural-motifs\lib\fpn\nms\src\nms_cuda.obj"
nms_cuda.c
D:\Master Thesis\neural-motifs\lib\fpn\nms\src\nms_cuda.c(12): warning C4244: 'initializing': conversion from 'int64_t' to 'const int', possible loss of data
D:\VSShit\IDE\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:D:\Cuda/lib/x64 "/LIBPATH:C:\Program Files\NVIDIA Corporation\NvToolsExt\/lib/x64" /LIBPATH:D:\anaconda\envs\neural-motifs\lib\site-packages\torch\utils\ffi\..\..\lib /LIBPATH:D:\anaconda\envs\neural-motifs\libs /LIBPATH:D:\anaconda\envs\neural-motifs\PCbuild\amd64 /LIBPATH:D:\VSShit\IDE\VC\Tools\MSVC\14.29.30133\lib\x64 "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64" /EXPORT:PyInit__nms .\Release\_nms.obj ".\Release\Master Thesis\neural-motifs\lib\fpn\nms\src\nms_cuda.obj" "D:\Master Thesis\neural-motifs\lib\fpn\nms\src/cuda/nms.cu.o" /OUT:.\_nms.pyd /IMPLIB:.\Release\_nms.lib
LINK : fatal error LNK1181: cannot open input file 'D:\Master Thesis\neural-motifs\lib\fpn\nms\src\cuda\nms.cu.o'
Traceback (most recent call last):
  File "D:\anaconda\envs\neural-motifs\lib\distutils\_msvccompiler.py", line 519, in link
    self.spawn([self.linker] + ld_args)
  File "D:\anaconda\envs\neural-motifs\lib\distutils\_msvccompiler.py", line 542, in spawn
    return super().spawn(cmd)
  File "D:\anaconda\envs\neural-motifs\lib\distutils\ccompiler.py", line 909, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "D:\anaconda\envs\neural-motifs\lib\distutils\spawn.py", line 38, in spawn
    _spawn_nt(cmd, search_path, dry_run=dry_run)
  File "D:\anaconda\envs\neural-motifs\lib\distutils\spawn.py", line 81, in _spawn_nt
    "command %r failed with exit status %d" % (cmd, rc))
distutils.errors.DistutilsExecError: command 'D:\\VSShit\\IDE\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\link.exe' failed with exit status 1181

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\anaconda\envs\neural-motifs\lib\site-packages\cffi\ffiplatform.py", line 51, in _build
    dist.run_command('build_ext')
  File "D:\anaconda\envs\neural-motifs\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "D:\anaconda\envs\neural-motifs\lib\site-packages\setuptools\command\build_ext.py", line 79, in run
    _build_ext.run(self)
  File "D:\anaconda\envs\neural-motifs\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "D:\anaconda\envs\neural-motifs\lib\distutils\command\build_ext.py", line 339, in run
    self.build_extensions()
  File "D:\anaconda\envs\neural-motifs\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "D:\anaconda\envs\neural-motifs\lib\distutils\command\build_ext.py", line 448, in build_extensions
    self._build_extensions_serial()
  File "D:\anaconda\envs\neural-motifs\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial
    self.build_extension(ext)
  File "D:\anaconda\envs\neural-motifs\lib\site-packages\setuptools\command\build_ext.py", line 202, in build_extension
    _build_ext.build_extension(self, ext)
  File "D:\anaconda\envs\neural-motifs\lib\distutils\command\build_ext.py", line 558, in build_extension
    target_lang=language)
  File "D:\anaconda\envs\neural-motifs\lib\distutils\ccompiler.py", line 717, in link_shared_object
    extra_preargs, extra_postargs, build_temp, target_lang)
  File "D:\anaconda\envs\neural-motifs\lib\distutils\_msvccompiler.py", line 522, in link
    raise LinkError(msg)
distutils.errors.LinkError: command 'D:\\VSShit\\IDE\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\link.exe' failed with exit status 1181

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "build.py", line 35, in <module>
    ffi.build()
  File "D:\anaconda\envs\neural-motifs\lib\site-packages\torch\utils\ffi\__init__.py", line 184, in build
    _build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
  File "D:\anaconda\envs\neural-motifs\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\envs\neural-motifs\lib\site-packages\cffi\api.py", line 727, in compile
    compiler_verbose=verbose, debug=debug, **kwds)
  File "D:\anaconda\envs\neural-motifs\lib\site-packages\cffi\recompiler.py", line 1565, in recompile
    compiler_verbose, debug)
  File "D:\anaconda\envs\neural-motifs\lib\site-packages\cffi\ffiplatform.py", line 22, in compile
    outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
  File "D:\anaconda\envs\neural-motifs\lib\site-packages\cffi\ffiplatform.py", line 58, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.VerificationError: LinkError: command 'D:\\VSShit\\IDE\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\link.exe' failed with exit status 1181
make: *** [Makefile:2: all] Error 1

Someone had some problems to execute this code on Windows or solved a similar problem?
If none of the above, someone knows a project in which I can easily produce scene graphs from images?

Thank you for your help!