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.31k stars 297 forks source link

AttributeError: module 'cuda_functions.nms_3D._ext.nms' has no attribute 'gpu_nms' #75

Open lovedoubledan opened 5 years ago

michelbotros commented 4 years ago

Have the same issue, someone solved this? I have recompiled the cuda functions as specified in the readme, but still @pfjaeger :

Traceback (most recent call last): File "exec.py", line 176, in train(logger) File "exec.py", line 70, in train results_dict = net.train_forward(batch) File "models/retina_unet.py", line 404, in train_forward detections, class_logits, pred_deltas, seg_logits = self.forward(img) File "models/retina_unet.py", line 511, in forward detections = refine_detections(self.anchors, flat_class_softmax, flat_bb_outputs, batch_ixs, self.cf) File "models/retina_unet.py", line 250, in refine_detections class_keep = nms_3D(torch.cat((ix_rois, ix_scores.unsqueeze(1)), dim=1), cf.detection_nms_threshold) File "/medicaldetectiontoolkit/cuda_functions/nms_3D/pth_nms.py", line 16, in nms_gpu nms.gpu_nms(keep, num_out, dets, thresh) AttributeError: module 'cuda_functions.nms_3D._ext.nms' has no attribute 'gpu_nms'

michelbotros commented 4 years ago

Adding some details. I'm trying to run this toolkit in a docker image and am using:

nvidia/cuda:9.0-devel-ubuntu16.04 python3.6

During build.py I am getting warnings, which are probably causing the error mentioned above.

warning: initialization from incompatible pointer type [-Wincompatible-pointer-types] unsigned long long* mask_flat = THCudaLongTensor_data(state, mask);

Anyone seen/solved this issue?

amberhappy commented 4 years ago

I have same problem with: Quadro RTX8000, Ubuntu18 and cuda10.1. Did you solve it?

CLL308 commented 4 years ago

I have same warning , 2080Ti, UBUNTU 16.04, Did you solve it?

Junye-Chen commented 1 year ago

Have the same issue, someone solved this? I have recompiled the cuda functions as specified in the readme, but still @pfjaeger :

Traceback (most recent call last): File "exec.py", line 176, in train(logger) File "exec.py", line 70, in train results_dict = net.train_forward(batch) File "models/retina_unet.py", line 404, in train_forward detections, class_logits, pred_deltas, seg_logits = self.forward(img) File "models/retina_unet.py", line 511, in forward detections = refine_detections(self.anchors, flat_class_softmax, flat_bb_outputs, batch_ixs, self.cf) File "models/retina_unet.py", line 250, in refine_detections class_keep = nms_3D(torch.cat((ix_rois, ix_scores.unsqueeze(1)), dim=1), cf.detection_nms_threshold) File "/medicaldetectiontoolkit/cuda_functions/nms_3D/pth_nms.py", line 16, in nms_gpu nms.gpu_nms(keep, num_out, dets, thresh) AttributeError: module 'cuda_functions.nms_3D._ext.nms' has no attribute 'gpu_nms'

reinstall can fix it.

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

ClimberXIE commented 1 year ago

Thanks so much!!! I have solved it now!