Wide resnet not found

Hi everyone,

I am trying to use the pre-trained models in pytorch and I am encountering problems with wide_resnet.

The part of the code that is suposed to access it is:

elif featEx==“resnext”:
self.featEx = torchModels.resnext101_32x8d(pretrained=True)
elif featEx==“wideresnet”:
self.featEx = torchModels.wide_resnet101_2(pretrained=True)

I have managed to get all the other models to work (I have left in the code for resnext as an example), but when I try to use it with the wide_resnet I get:

AttributeError: module ‘torchvision.models’ has no attribute ‘wide_resnet101_2’

I am thinking this is possibly a pytorch version problem but have been trying to update to the latest version without apparent success.

Which torchvision version are you using?
You can get it via print(torchvision.__version__).
This model was added ~10 months ago.

Thanks for your answer.

My torchvision version is:


0.3.0 doesn’t contain this model as seen here and is too old.
I would recommend to update to the latest stable version (0.6.0), which will contain this model as well as other new features and bug fixes.

Once you are about to update torchvision also update PyTorch, as I assume you might be using an older PyTorch version as well.

Just for completeness, the answer was totally correct.Thanks a lot.

After finding a newer version of pytorch and torchvision, the model works fine with the above code.