Dimensionality issues in transfrom #918
-
My monai version is 0.8.1. I am working on a classification task for 3d images. I am making predictions by resizing the image to (96,96,32). Why does it always report the error that the size is not the same when I run it. The specific error is: RuntimeError: stack expects each tensor to be equal size, but got [1, 96, 96, 32] at entry 0 and [1, 32, 96, 96] at entry 1. Where I'm confused is why is 32 sometimes on x and sometimes on z? My transform code is as follows:
I would like to ask the developers or other experienced partners to help me out, thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @shenao1994, it seems you had set the |
Beta Was this translation helpful? Give feedback.
Hi @shenao1994, it seems you had set the
spatial_axes
inRandRotate90d
incorrectly. Thespatial_axes
defines the plane to rotate with 2 spatial axes. (0, 2) means rotate in the XZ plane which will invert the dimensions of x and z, so you can simplify set it as (0,1).Hope it can help you! If you have any other problem, free feel to ask me!