Fine tuning with existing model
See original GitHub issueHi,
I tried to train a model with a custom dataset and the resnet101 backbone. I noticed that while half of the bounding boxes looked accurate, the masks were completely off. I checked drew the annotations and verified that they are correct.
It could be due to the size of the dataset: 1357 images and 21 classes. I would like to use yolact_im700_54_80000.pth
and fine tune it with my custom classes to see if this improves my results. What would be the steps to do this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Transfer learning and fine-tuning | TensorFlow Core
Fine -Tuning: Unfreeze a few of the top layers of a frozen model base and jointly train both the newly-added classifier layers and...
Read more >Fine-tune a pretrained model - Hugging Face
When you use a pretrained model, you train it on a dataset specific to your task. This is known as fine-tuning, an incredibly...
Read more >Fine-Tune a Model - Amazon SageMaker
Fine -tuning trains a pretrained model on a new dataset without training from scratch. This process, also known as transfer learning, can produce...
Read more >Tutorial: Fine-Tuning a Model on Your Own Data - Haystack
For many use cases it is sufficient to just use one of the existing public models that were trained on SQuAD or other...
Read more >Fine tuning existing model - Google Groups
and it works fine. Now I'm trying to modify it to fine tune the existing eng model. I made a few attempts, all...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t have explicit support for that, but you can probably get that to work by changing this line: https://github.com/dbolya/yolact/blob/a70b68dd70aac5a1f41789771a66fb33adba2809/yolact.py#L473 Replace that with
and then resume training from
yolact_im700_54_80000.pth
:python train.py --config=<your_config> --resume=weights/yolact_im700_54_800000.pth --start_iter=0
When there are size mismatches between tensors, Pytorch will spit out an error message but also keep on loading the rest of the tensors anyway. So here we just attempt to load a checkpoint with the wrong number of classes, eat the errors the Pytorch complains about, and then start training from iteration 0 with just those couple of tensors being untrained. You should see only the C (class) and S (semantic segmentation) losses reset.
You probably also want to modify the learning rate, decay schedule, and number of iterations in your config to account for fine-tuning.
@hana9090
Those look reset to me? They should reset to a similar value as what they start out as, and C starts > 10 and goes down to < 5 so it looks like it reset.
And the loss key is in
multibox_loss.py
:I is now “Mask IoU loss”