Fengshenbang-LM
Fengshenbang-LM copied to clipboard
如何对IDEA-CCNL/Taiyi-CLIP-Roberta-large-326M-Chinese模型进行fine-tune?
你好,我想请问下,如何使用IDEA-CCNL/Taiyi-CLIP-Roberta-large-326M-Chinese在自己的数据集上进行微调?谢谢!
还没有正式发布,可以先参考 https://github.com/IDEA-CCNL/Fengshenbang-LM/tree/hf-ds/fengshen/examples/clip_finetune
好的,非常感谢。那么大概什么时候能正式发布呢?
还没有正式发布,可以先参考 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。
微调示例: 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
微调示例: 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的方式保存模型,发现微调模型参数并没有改变,不知道是什么原因。