convolutional neural networks todaywe have plenty of pretrained networks that were trained for several hours on large corpus of datasets that almost represent most common objects we come across large number of these networks are readily available under pytorch we can directly leverage them instead of training our own network from scratch for more information about the available list of pretrained modelsvisit for our use caselet' use vggnet listing - demonstrates downloading and leveraging vggnet for transfer learning listing - downloading and initializing the pretrained model #download the model (pretrainedfrom torchvision import models new_model models vgg (pretrained=truefreeze model weights for param in new_model parameters()param requires_grad false print(new_model classifieroutput[sequential( )linear(in_features= out_features= bias=true( )relu(inplace=true( )dropout( = inplace=false( )linear(in_features= out_features= bias=true( )relu(inplace=true( )dropout( = inplace=false( )linear(in_features= out_features= bias=true