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

TypeError: crop_and_resize_forward expected 7 arguments, got 8 when running on cpu #126

Open themantalope opened 3 years ago

themantalope commented 3 years ago

Hi,

I'm trying to troubleshoot some cryptic errors when running on cuda, so I tried to run everything on the CPU. However, there is an issue with the implementation of crop_and_resize for the CPU:

Here is the declaration in crop_and_resize.h (for the cpu):

void crop_and_resize_forward(
    THFloatTensor * image,
    THFloatTensor * boxes,      // [y1, x1, y2, x2]
    THIntTensor * box_index,    // range in [0, batch_size)
    const float extrapolation_value,
    const int crop_height,
    const int crop_width,
    THFloatTensor * crops
);

Likewise for the GPU:

void crop_and_resize_gpu_forward(
    THCudaTensor * image,
    THCudaTensor * boxes,           // [y1, x1, y2, x2]
    THCudaIntTensor * box_index,    // range in [0, batch_size)
    const float extrapolation_value,
    const int crop_height,
    const int crop_width,
    const int crop_zdepth,
    THCudaTensor * crops
);

In the CPU implementation, there is no const int crop_zdepth parameter - thus the rest of the code breaks down when trying to run this with the mrcnn network model. I do not have anywhere near enough experience to fix the cpu function, but I thought I'd bring it up.