This seems to be due to this commit 6, which I guess was not present with the torchvision version shipped with 0.4.1? (I don’t really understand the versioning in this case)
Since nn.AdaptiveAvgPool2d is not a learnable layer, I think you could just add it to your model before running inference, as follows:
age_model.avgpool = nn.AdaptiveAvgPool2d((7, 7))

I think you can get rid of the warnings by saving the model from pytorch 1.0 and then loading it back…?