Skip to content

Does the input tensor need to be resized as (224, 224)? #237

Answered by frgfm
kitaharasetusna asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @kitaharasetusna 👋

This project was meant to bring as much flexibility as possible, so it does not introduce a bias for image size. However the models you're using may do so. If you use a resnet18 trained on (224,224) inputs, passing (32,32) will not likely produce good things.

To give you a better understanding of the inner works of a resnet18, using TorchScan:

from torchscan import summary
from torchvision import resnet18

model = resnet18().eval()
summary(model, (3, 224, 224), max_depth=2)

yields

_________________________________________________________________
Layer        Type                 Output Shape          Param #  
========================================================…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kitaharasetusna
Comment options

Answer selected by kitaharasetusna
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants