I’m not deeply familiar with the cnn_learner class, but based on this line of code 57 it should contain the model instance as an attribute, which might be used to save the state_dict directly.



 JonathanSum:

How do I defind a model definition that the model I used was from fastai that I don’t even know it?


Based on your code the actual model might just be torchvision.models.resnet34.
You could try to create an instance of this model and load the state_dict.