How to load a model from the .pth

#2
by MaelM - opened

Hello and thank you for the amazing work!

I am struggling to load the model weights.
I am trying to use the weights from best_transpath.pth.
I imported the ctranspath model from the official GitHub repository, but the keys in its state_dict do not match the keys in the best_transpath.pth state_dict.
For example, the ctranspath state_dict has 202 keys, whereas the best_transpath.pth state_dict has 329 keys.

Could you please help me understand what I am doing wrong?
Thank you very much in advance, and if you do not have time right now, I will gladly wait for the full release.

Thank you for your kind words and reaching out to us. Since the official page of CTranspath has updated their weights even we faced the same issue. So we highly encourage you to use the ctranspath model we provided in the code and load best_transpath.pth file from our model weights. It will definitely run without any error. Thank you again for your patience and support.

Hello Baru93,
Thank you for your response. Your suggestion worked.
Sincerely,

Sign up or log in to comment