You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
device = torch.device("cuda:0")
model = SwinUNETR(
img_size=(512,512,64),#this is not an argument anymore
spatial_dims=3,
in_channels=2,
out_channels=3,
feature_size=48,
drop_rate=0.0,
attn_drop_rate=0.0,
dropout_path_rate=0.0,
use_checkpoint=True
).to(device)
DeprecatedError: Argument img_size was removed in version 1.5. The img_size argument is not required anymore and checks on the input size are run during forward().
But
model = SwinUNETR(
# img_size=(512,512,64),#this is not an argument anymore
spatial_dims=3,
in_channels=2,
out_channels=3,
feature_size=48,
drop_rate=0.0,
attn_drop_rate=0.0,
dropout_path_rate=0.0,
use_checkpoint=True
).to(device)
TypeError: missing a required argument: 'img_size'
Expected behavior
Img_size is no longer needed but we have type error when not present and DeprecationError when present.
Good question I think I did pip install. It was a while back.
If I remove the deprecation type error in the code the swin runs.
Hi @joaomamede, yes. I know it's a bit of a mismatch, because we want to tell the user something through the deprecate message, but because the img_size doesn't have a default value, if we add a default value for it and change the position of the parameter, it may cause some users get error who specifying the parameters in order. Theoretically, if your monai version doesn't start with 1.5, there won't be a problem.
Describe the bug
Img_size argument is required, but not allowed at the same time
To Reproduce
print_config()
But
Expected behavior
Img_size is no longer needed but we have type error when not present and DeprecationError when present.
Environment
anaconda linux ubuntu 24.04
The text was updated successfully, but these errors were encountered: