Closed ctestagrose closed 2 years ago
Hi @ctestagrose Can you please post a small test snippet that someone can run ?
@vikashg @Nic-Ma
This code snippet should produce an error when using torchinfo. The error when using torchinfo is:
RuntimeError: Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [1, 1000]
The code snippet is as follows:
from monai.networks.nets import TorchVisionFCModel
from torchinfo import summary
model = TorchVisionFCModel(
"inception_v3", num_classes=4, pretrained=False, use_conv=False, pool=None
)
#model = torchvision.models.inception_v3()
summary(model, input_size = (1, 3, 299, 299))
Hi @ctestagrose, Yes I am getting the same error.
thanks, I looked into it and it's related to this issue https://discuss.pytorch.org/t/removing-2-layers-from-inception-pretrained-model-is-giving-errors/97554 I'll create a patch to fix it.
Awesome, I will look into it.
Thanks @wyli
Discussed in https://github.com/Project-MONAI/MONAI/discussions/4865