Muradean:

I am wondering if there is any fix I can do to solve this and perform inference with the pre-trained model.


You would have to change the model architecture such that all parameters match to the one in the pretrained state_dict.
If you are loading this state_dict from a repository, I assume the model definition might also be there.