Pytorch model zoo

(Nick Switanek) #1

Just working through the lesson1-pets notebook, which involves using resnet34, resnet50, and resnet18, all downloaded from the PyTorch site. There is mention of a model zoo on the PyTorch site, but the docs seem opaque on which models are available and how to access them.

Where can one find documentation for the models that are available and how to load them?

(Ilona) #2

You should check out the fastai docs, where they have provided a link for the available pytorch models, and also extended that list.
For usage, if we are talking about an application related to vision, you can pass the desired model to a ConvLearner as a parameter: models.resnet18, models.densenet169 etc. as shown in the first lesson with models.resnet50/models.resnet34.

(Nick Switanek) #3

Thanks kindly, Ilona.

It’s powerful to have easy access to so many models…

(Ilona) #4

It is, indeed!


And we’ll add more in the future :wink:

(Willismar Medeiros) #6

@sgugger, @jeremy

Hey look what this guys are doing. :slight_smile:

(Jeremy Howard (Admin)) #7

Yup we know Remi well :slight_smile:

(yogesh gurjar) #8

I am trying to use densenet in with create_cnn() but it gives me error how can i Use densnet in for transfer learning –
I get the following error in default pipeline-
arch = models.densenet169

AttributeError: module '' has no attribute 'densenet169'

(Nick Switanek) #9

DenseNet isn’t available by default in the fastai library, so I believe you’ll need to import it from torchvision.models:

from torchvision.models import densenet161

(yogesh gurjar) #10

I figure it out how to use torchvision model but when go for the pretrainedmodels pytorch cadene libaray I can’t use the nasnetamobile or pnasnet can you help me with this.

(Yash Mittal) #11

Can u please tell us how you have done that?

(Sam) #12

I have been playing with Cifar10 dataset for the last week or so with fastai-V1.
Remi’s pretrained models Squeeze-n-Excitation (se_resnet50) and fastai V1. I got my new year’s gift.
Accuracy 0.9627
Cifar10-se_resnet.pdf (850.4 KB)

(Pierre Guillou) #13

Just one thing about passing models.densenetxxx, I got the following warning (cc @sgugger):


I think that’s an issue for torchvision.

(K Doherty) #15

Regarding densenet models, they seem to really suck up GPU memory relative to resnets. Does anyone else notice this?

(Andrew Nguyen) #16

Yes. Jeremy talks about that in Lesson 7 here. The timestamp I’ve given begins his discussion of it, and he gets to exactly why that is about 2mins in.

(K Doherty) #17

Thanks for sharing. Would anyone happen to know which dataset the densenets were trained on initially?