-
If I add train_transforms = Compose(
[
LoadImaged(keys=["image", "label"]),
modelio.ExtractChannelTransform(keys=["image"], channel_ids=channel_ids),
AddChanneld(keys=["label"]),
RandFlipd(keys=["image", "label"], prob=0.5, spatial_axis=1),
RandFlipd(keys=["image", "label"], prob=0.5, spatial_axis=0),
RandCoarseDropoutd(
keys=["image", "label"],
fill_value=0,
prob=0.5,
# sizes are for channel, height, width
spatial_size=(-1, 32, 32),
max_spatial_size=(-1, 64, 128),
holes=4,
max_holes=16,
),
RandAffined(
keys=["image", "label"],
prob=0.75,
padding_mode="zeros",
rotate_range=np.pi,
translate_range=15,
shear_range=0.25,
scale_range=0.25,
mode=("bilinear", "nearest"),
),
ToTensord(keys=["image", "label"]),
]
) and trace:
|
Beta Was this translation helpful? Give feedback.
Answered by
dzenanz
Sep 20, 2022
Replies: 1 comment
-
The problem was in spatial sizes. I should not have supplied channel dimension. Instead of spatial_size=(-1, 32, 32),
max_spatial_size=(-1, 64, 128), this works (in the sense that it does not crash): spatial_size=(32, 32),
max_spatial_size=(64, 128), |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
dzenanz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The problem was in spatial sizes. I should not have supplied channel dimension. Instead of
this works (in the sense that it does not crash):