sepid_kh:

I am not familiar with the eager model. I just guess you mean I should apply pytorch_to_keras for fine-tuning?


No, by “eager mode” I meant the “normal” PyTorch model without scripting.



 sepid_kh:

I work with big data, and it takes more than one week to train the model! so if I just want to change the size of a Linear layer like ( self.fc = nn.Linear(64,1)) to ( self.fc = nn.Linear(4096,1)) it is not possible, and I should modify the model and train that from the beginning?!


You can directly change the layer in the model before scripting it. E.g. something like this would work:
model = MyModel()
model.fc = nn.Linear(...)
model_scripted = torch.jit.script(model) # script afterwards

# manipulating the scripted model might fail
model_scripted.fc = nn.Linear(...)

Would this work for your use case or do you need to load an already scripted model (and somehow cannot manipulate it beforehand)?