sovit-123 / fasterrcnn-pytorch-training-pipeline

PyTorch Faster R-CNN Object Detection on Custom Dataset
MIT License
223 stars 75 forks source link

Transfer Learning or Finetune method #151

Closed Subhankhan41 closed 3 months ago

Subhankhan41 commented 3 months ago

Hi Sovit,

Thanks again for producing great tutorials for us to learn deep learning. I tried the Faster RCNN with my custom dataset and it works fine. Now, after completing the training, I want to finetune my model and instead of starting from scratch I want to start the new training from the best_model.pth. Could you please let me know how can I perform transfer learning or finetuning?

Thanks

sovit-123 commented 3 months ago

Sure. If you want to use previously trained weights, you can use the same training command with some additional changes to the command line arguments.

python train.py --weights <path to the weights.pth file> --epochs <num epochs> --resume-training

With the above command, provide the rest of the command line arguments like dataset YAML path and others.

I hope this helps.

Subhankhan41 commented 3 months ago

Great. Thanks a lot Sovit, you're a legend!