RandSpatialCropSamples MONAI transformation throws AttributeError: 'dict' object has no attribute 'shape' #5628
nehagianchandani
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to crop N samples (each of size 64,64,64) from each image (3d) of my dataset. I am using the RandSpatialCropSamples transformation.
On running my code the following error is thrown:
dict' object has no attribute 'shape' when I call the getitem() function on the Dataset object or when I call the DataLoader function in Monai.
Some important code snippets are added below:
My transformations:
The error output:
Questions:
I tried the call() function to apply this transformation on a single image and it works as expected.
Thanks.
UPDATE:
I figured out the solution. I was simply supposed to use the dict wrappers of MONAI transforms (transform names ending with 'd') Link
Beta Was this translation helpful? Give feedback.
All reactions