-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ResNet class does not respect argument feed_forward=False #3314
Copy link
Copy link
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Describe the bug
The ResNet class has a parameter feed_forward which allows skipping of the final dense layer if I intepret that correctly. A respective layer is only created if the parameter is set to True (see here) but in the forward pass, there is no query for whether the layer actually exists see here.
To Reproduce
import torch
from monai.networks.nets.resnet import resnet50
x = torch.ones((1, 1, 64, 64, 64))
model_monai = resnet50(spatial_dims=x.ndim-2, n_input_channels=x.shape[1], feed_forward=False)
print(model_monai)
# throws an error
y = model_monai(x)Expected behavior
The ResNet class should not throw an error if feed_forward=False.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested