Do I need to "reset" a pre-trained model?

I heard a few times in the video that the model is pre-trained. Thus, I am thinking when I call unfreeze and then fit_one_cycle that the pre-trained model is updated with new weights and the original model on my system is now ‘not original’ anymore.

I am trying to figure out if I need to consider resetting the pre-trained model back to it’s initial state, and if so, how to do that.

1 Like

Hi Karl,

Exactly right.

I am trying to figure out if I need to consider resetting the pre-trained model back to it’s initial state

If you want to start over from the original pre-trained model, reset. If you want to continue training, don’t.

if so, how to do that

Go back and run the cnn_learner() call that created the model. It will make a fresh model with the original pre-trained weights.

HTH :slightly_smiling_face:

Perfect!.. confusion solved :slight_smile:

One more question… is the model resnet34 the ‘pre-trained’ model, or is that a static structure the model is trained upon.

Where is the ‘pre-trained’ part of the system?

resnet34 is the architecture of the model, its layers and connections, irrespective of its weights. When cnn_learner() is given pretrained=True, the layers are initialized with weights and biases from resnet34 already trained on ImageNet. This pretrained model will already be competent to classify typical images. If pretrained=False, weights and biases are initialized randomly. You will need to train them before they understand anything about images. Note that cnn_learner() alters the resnet34 architecture to suit your particular task.

Transfer learning is a central concept in fastai. Check out the docs here…
https://docs.fast.ai/vision.learner.html#Transfer-learning

HTH, :slightly_smiling_face:

Now I am crystal clear… thanks and thanks again!