mmpretrain icon indicating copy to clipboard operation
mmpretrain copied to clipboard

[Feature] 如何加载预训练模型进行finetune?

Open chen1234520 opened this issue 1 year ago • 4 comments

Describe the feature

train.py文件中只有--resume,没有--checkpoint,如何加载预训练模型进行finetune操作呢?

Will you implement it?

  • [x] I would like to implement this feature and create a PR!

chen1234520 avatar May 07 '24 10:05 chen1234520

same question.

zhengyuan-xie avatar Jul 15 '24 07:07 zhengyuan-xie

+1

abcc235 avatar Aug 27 '24 15:08 abcc235

可以直接在配置文件里面增加pretrained参数

model = dict( type='ImageClassifier', pretrained = 'convnextv2/convnext-v2-tiny_3rdparty-fcmae_in1k_20230104-80513adc.pth', backbone=dict( type='ConvNeXt', arch='tiny', drop_path_rate=0.1, layer_scale_init_value=0., use_grn=True, ),

skywalkerfmc avatar Oct 10 '24 11:10 skywalkerfmc

@skywalkerfmc If you want to conduct fcma training yourself, how should you change the training configuration file and training data? Or use Facebook's code for fcma training. How to use this code for fine-tuning? Can the weights of the warehouse training be directly loaded for inference using timm?

watertianyi avatar Oct 11 '24 06:10 watertianyi