MIC-DKFZ / medicaldetectiontoolkit

The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.
Apache License 2.0
1.3k stars 297 forks source link

HELP! #26

Closed wgs123 closed 5 years ago

wgs123 commented 5 years ago

In mrcnn.py ,I meet a error File "models/mrcnn.py", line 24, in from cuda_functions.nms_2D.pth_nms import nms_gpu as nms_2D File "C:\medicaldetectiontoolkit-master\cuda_functions\nms_2D\pth_nms.py", line 2, in from ._ext import nms File "C:\medicaldetectiontoolkit-master\cuda_functions\nms_2D_ext\nms__init__.py", line 3, in from ._nms import lib as _lib, ffi as _ffi ModuleNotFoundError: No module named 'cuda_functions.nms_2D._ext.nms._nms', could you help me solve it?

pfjaeger commented 5 years ago

Hi did you re-compile the cuda_functions? What GPU are you using? So when cloning the repo it comes with this file: cuda_functions/nms_2D/_ext/nms/_nms.so Did you somewho lose this?

wgs123 commented 5 years ago

Thank you for your reply.I using GTX 1080,what is the meaning the follow statement? nvcc -c -o nms_kernel.cu.o nms_kernel.cu -x cu -Xcompiler -fPIC -arch=[arch]

YoussefBenDhieb commented 5 years ago

Hi,

You can solve it by recompiling the cuda functions using this code:

cd cuda_functions/roi_align_2D/roi_align/src/cuda/ nvcc -c -o crop_and_resize_kernel.cu.o crop_and_resize_kernel.cu -x cu -Xcompiler -fPIC -arch=compute_61 cd ../../ python build.py cd ../../

cd roi_align_3D/roi_align/src/cuda/ nvcc -c -o crop_and_resize_kernel.cu.o crop_and_resize_kernel.cu -x cu -Xcompiler -fPIC -arch=compute_61 cd ../../ python build.py cd ../../

cd nms_2D/src/cuda/ nvcc -c -o nms_kernel.cu.o nms_kernel.cu -x cu -Xcompiler -fPIC -arch=compute_61 cd ../../ python build.py cd ../

cd nms_3D/src/cuda/ nvcc -c -o nms_kernel.cu.o nms_kernel.cu -x cu -Xcompiler -fPIC -arch=compute_61 cd ../../ python build.py cd ../

note the compute_61 is the architecture of the GTX 1080. So for other graphics cards you have to change it to a compatible architecute.

wgs123 commented 5 years ago

Thank you for your help, but I also meet a error using this code C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt.h(10) : fatal error C1083: “vcruntime.h”: No such file or directory Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\distutils_msvccompiler.py", line 423, in compile self.spawn(args) File "C:\ProgramData\Anaconda3\lib\distutils_msvccompiler.py", line 542, in spawn return super().spawn(cmd) File "C:\ProgramData\Anaconda3\lib\distutils\ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "C:\ProgramData\Anaconda3\lib\distutils\spawn.py", line 38, in spawn _spawn_nt(cmd, search_path, dry_run=dry_run) File "C:\ProgramData\Anaconda3\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 12.0\VC\BIN\cl.exe' failed with exit status 2

YoussefBenDhieb commented 5 years ago

Try to reinstall visual studio.

wgs123 commented 5 years ago

I reinstall visual studio, but the problem also remain

YoussefBenDhieb commented 5 years ago

Did you install the visual c++ build tools with it? Also when launching cmd or anaconda prompt, launch it with administrator privilege.