Spacingd with cuda type tensor is NOT working #3074
-
According to https://docs.monai.io/en/latest/highlights.html , all the geometric image transforms (Spacing, Zoom, Rotate, Resize, etc.) support GPU acceleration via GPU Tensor operations for high performance. TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. I use DecathlonDataset(prostate) with Compose([LoadImaged, EnsureChannelFirstd, Orientationd, EnsureTyped, CropForegroundd, NormalizeIntensityd, ToDeviced, RandFlipd, Spacingd, RandCropByPosNegLabeld]). Thank you in advance!!! :) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
Hi @JoohyungLee0106, I've moved this discussion from the tutorials repo to here. Could you give the full trace of the error (all the error message). It will help figure out which object is being unsuccessfully handled. Also which version of monai are you using? Our unit test checks that |
Beta Was this translation helpful? Give feedback.
-
1) package version:python: 3.7.11 2) full arguments of the transforms:
3) full trace of the error:
|
Beta Was this translation helpful? Give feedback.
-
Sure!!
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
I have upgrade monai via
pip install monai --upgrade
=>
Spacingd
still doesn't work with cuda tensor.I have installed Weekly preview release via
pip install monai-weekly
=>
Spacingd
DOES work with cuda tensor.Thank you for the suggestion, @Nic-Ma and @rijobro !!!