直接把CLIP_CN_Tutorial里的微调代码复制到modelscope自带的notebook,但是报错:
Traceback (most recent call last):
File "/opt/conda/lib/python3.10/site-packages/modelscope/utils/registry.py", line 212, in build_from_cfg
return obj_cls(**args)
File "/opt/conda/lib/python3.10/site-packages/modelscope/trainers/multi_modal/clip/clip_trainer.py", line 100, in init
len(train_dataset) / # noqa
ZeroDivisionError: division by zero
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/workspace/clip_train_entry.py", line 158, in
trainer = build_trainer(
File "/opt/conda/lib/python3.10/site-packages/modelscope/trainers/builder.py", line 39, in build_trainer
return build_from_cfg(cfg, TRAINERS, default_args=default_args)
File "/opt/conda/lib/python3.10/site-packages/modelscope/utils/registry.py", line 215, in build_from_cfg
raise type(e)(f'{obj_cls.name}: {e}')
ZeroDivisionError: CLIPTrainer: division by zero
请问如何解决
训练数据集的长度为零
如果数据集加载成功,但是训练过程中出现了除以零的错误,可能是因为数据预处理过程中出现了问题。您可以仔细检查数据预处理的代码,确保没有出现错误。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。