Why call cpu() in grab_idx?

I’m curious why we move stuffs out of CUDA here.

I’m trying to speed up object detection’s mAP calculation using on_epoch_end callback. This requires calling non-maximum suppression which has CUDA-optimized implementations.

grab_idx is used by show_results which doesn’t care about the GPU. You shouldn’t be using it inside a metric that you want computed on the GPU.

1 Like