ml-cvnets icon indicating copy to clipboard operation
ml-cvnets copied to clipboard

Recommendations for configuring heads/training on custom datasets?

Open lessw2020 opened this issue 2 years ago • 4 comments

Thanks for developing MobileVit! I'm wondering if there are any specific tips/examples for fine-tuning the pre-trained classification and detection models using mobilevit on custom datasets? I see the n_classes reference in both classifier (1000) and detection (80), but can you provide any quick example of modifying for custom datasets and if you have any recommended lr for finetuning? Thanks very much!

lessw2020 avatar Oct 25 '21 16:10 lessw2020

I was able to do some surgery to rework mobilevit classifier to be trainable within Jupyter notebook and customize the fc to match the original ImageNet setup.
It is doing extremely well fine tuning with lr=9e-4 (using Ranger21 optimizer). If it helps others, here's how I modified the fc (my current work is binary classification so it's 2 instead of 1000).
I think it would be nice to add in this as a simple function call much like how it's done in Timm. I can do a PR for it if interested. mvit_customized

lessw2020 avatar Oct 27 '21 23:10 lessw2020

do you think you could share the jupyter notebook for training?

batrlatom avatar Dec 22 '21 09:12 batrlatom

https://colab.research.google.com/drive/1xj9SKPL0rntUCNoXHi6GHOOdhaLwfTu2?usp=sharing

ksivajana avatar Mar 02 '22 20:03 ksivajana

@lessw2020 Inspired by this issue, we have added the functionality of fine-tuning pre-trained classification backbones on other classification datasets in v0.2 of this library. See fine-tuning example here.

sacmehta avatar Jun 28 '22 04:06 sacmehta

Closing issue because of no activity

sacmehta avatar Oct 30 '22 02:10 sacmehta