So, got a fix for this

I had to ensure the exact function used for he model during training was also available

e.g., for dpn98, I used weights from https://github.com/Cadene/pretrained-models.pytorch … so, I needed to have the function below in the main module from which I started the inference execution

During training, I used below

import pretrainedmodels

from fastai import *

from fastai.vision.all import *

def dpn131(pretrained=False):

pretrained = ‘imagenet’ if pretrained else None

model = pretrainedmodels.dpn131(pretrained=pretrained)

return nn.Sequential(*list(model.children()))

For inference, I just needed to ensure the function is defined/accessible from same main module

def dpn131(pretrained=False):

pass

**PS**: I have switched to using https://github.com/rwightman/pytorch-image-models/ now though as it is much friendlier with fastai library, and equally contains much more model architectures