Fengshenbang-LM icon indicating copy to clipboard operation
Fengshenbang-LM copied to clipboard

如何对IDEA-CCNL/Taiyi-CLIP-Roberta-large-326M-Chinese模型进行fine-tune?

Open gongshaojie12 opened this issue 2 years ago • 5 comments

你好,我想请问下,如何使用IDEA-CCNL/Taiyi-CLIP-Roberta-large-326M-Chinese在自己的数据集上进行微调?谢谢!

gongshaojie12 avatar Jul 28 '22 07:07 gongshaojie12

还没有正式发布,可以先参考 https://github.com/IDEA-CCNL/Fengshenbang-LM/tree/hf-ds/fengshen/examples/clip_finetune

ganzhiruyi avatar Aug 04 '22 02:08 ganzhiruyi

好的,非常感谢。那么大概什么时候能正式发布呢?

gongshaojie12 avatar Aug 04 '22 06:08 gongshaojie12

还没有正式发布,可以先参考 https://github.com/IDEA-CCNL/Fengshenbang-LM/tree/hf-ds/fengshen/examples/clip_finetune

你好,可否分享一下微调太乙的环境requirements,昨天在单卡以及多卡调试均会报错,单卡错误 AssertionError: Attempted unscale_ but _scale is None. This may indicate your script did not use scaler.scale(loss or outputs) earlier in the iteration. 查了一下感觉是版本的问题,我当前pytorch_lightning版本是1.7.0。

scarydemon2 avatar Aug 10 '22 02:08 scarydemon2

微调示例: https://github.com/IDEA-CCNL/Fengshenbang-LM/tree/main/fengshen/examples/clip_finetune finetune clip的相关版本: pytorch-lightning 1.6.2 torch 1.9.0+cu111 torch-tb-profiler 0.3.1 torchaudio 0.9.0 torchmetrics 0.8.2 torchsummary 1.5.1 torchvision 0.10.0+cu111

ganzhiruyi avatar Aug 10 '22 02:08 ganzhiruyi

微调示例: https://github.com/IDEA-CCNL/Fengshenbang-LM/tree/main/fengshen/examples/clip_finetune finetune clip的相关版本: pytorch-lightning 1.6.2 torch 1.9.0+cu111 torch-tb-profiler 0.3.1 torchaudio 0.9.0 torchmetrics 0.8.2 torchsummary 1.5.1 torchvision 0.10.0+cu111

感谢分享,代码成功跑起来了,但是依然有一些小问题。 1.单卡训练时,会报 image_mbs = torch.chunk(image, n) RuntimeError: chunk expects chunks to be greater than 0, got: 0错误 通过修改 n = max(1,math.ceil(len(image) // self.minibatch_size))可以在单卡下解决这个问题。 2.另外我发现clip_fintune代码跑完之后,我通过save_pretrained的方式保存模型,发现微调模型参数并没有改变,不知道是什么原因。

scarydemon2 avatar Aug 11 '22 09:08 scarydemon2