What is the list of Classes for any Pre-Trained Model


I have been using the VGG19 and DenseNet161 pretrained model for some time now. Actually, I wish to know the list of the classes these models are trained on (especially DenseNet model).

If you just load the model:

loaded_model = torchvision.models.densenet161(pretrained=True)

and if I predict an image to this


I want to know, which class it has the model predicted it to (not the index, I got the index)

In other words I need the list of the classes that DenseNet was trained on so as I can Map each 1000 classes to the list.

Thank You!

The models were trained on ImageNet and you can find the mapping in this thread.

Thank a lot :slight_smile: