while re-training a pre-trained model, I'm facing this issue RuntimeError: You must compile your model before using it
There 2 techniques while using the pre-train model

1. Transfer learning: In the case of transfer learning, we use the pre-train model to train on new kind of dataset so generally, remove the last layer and add a new layer into the network. At this point, as you are adding a new layer the model should be compiled. But don't worry if you are compiling it then weights will not be lost.

2. Retraining (I guess this is your case): As you are not modifying the architecture but just training it on additional dataset then also it is not going to loose weights.