Deb_Prakash_Chatterj:

model = models.resnet101(pretrained=True)


Try to print your pretrained model after loading, with print(model), and see what modules it contains currently. You will see that torchvision Resnet models contain a module named fc in the final layer. What you are trying to do is to fine-tune this layer. So, you don’t have to create a new classifier module, recreating your fc module would suffice. Do the same printing for inception-v3. This will give you a hint what layers you need to recreate. Try to read more on transfer learning or fine tuning in PyTorch.