0

I have a model composed of model_1, model_2, model_3. and the flow is model_1 and model_2 >>> model_3, how can I set that model _1 do not update and model_2 update. Note that the model_1 and model_2 with same structure and pretrained weights in the beginning of the training process. When I load one pretrained weight for model_1 and model_2, and frezze model_1 in the init, and I find that both models (model_1 and model_2 ) do not update in the trianing.

1 Answers1

0

You can overwrite the train() and eval() methods of your model such that they will only alter your desired sub-model.

An example and some more info regarding train(): What does model.train() do in PyTorch?

Tamir
  • 1,224
  • 1
  • 5
  • 18