InternVL icon indicating copy to clipboard operation
InternVL copied to clipboard

the problem about training on customdataset

Open Iron-Boyy opened this issue 2 years ago • 3 comments

Traceback (most recent call last): [rank5]: File "/mnt/mobile/luozhihao/playground/InternVL/internvl_chat/internvl/train/internvl_chat_finetune.py", line 1072, in [rank5]: main() [rank5]: File "/mnt/mobile/luozhihao/playground/InternVL/internvl_chat/internvl/train/internvl_chat_finetune.py", line 1057, in main [rank5]: train_result = trainer.train(resume_from_checkpoint=checkpoint) [rank5]: File "/mnt/mobile/luozhihao/envs/internvl3/lib/python3.9/site-packages/transformers/trainer.py", line 2123, in train [rank5]: return inner_training_loop( [rank5]: File "/mnt/mobile/luozhihao/envs/internvl3/lib/python3.9/site-packages/transformers/trainer.py", line 2481, in _inner_training_loop [rank5]: tr_loss_step = self.training_step(model, inputs, num_items_in_batch) [rank5]: File "/mnt/mobile/luozhihao/envs/internvl3/lib/python3.9/site-packages/transformers/trainer.py", line 3612, in training_step [rank5]: self.accelerator.backward(loss, **kwargs) [rank5]: File "/mnt/mobile/luozhihao/envs/internvl3/lib/python3.9/site-packages/accelerate/accelerator.py", line 2233, in backward [rank5]: self.deepspeed_engine_wrapped.backward(loss, **kwargs) [rank5]: File "/mnt/mobile/luozhihao/envs/internvl3/lib/python3.9/site-packages/accelerate/utils/deepspeed.py", line 195, in backward [rank5]: self.engine.step() [rank5]: File "/mnt/mobile/luozhihao/envs/internvl3/lib/python3.9/site-packages/deepspeed/runtime/engine.py", line 2208, in step [rank5]: assert not self.inside_no_sync_ctxt,
[rank5]: AssertionError: It is illegal to call Engine.step() inside no_sync context manager

how can i solve this error?

Iron-Boyy avatar Dec 02 '24 15:12 Iron-Boyy

I have the same problem. Did you manage to solve it?

kfzyqin avatar Dec 05 '24 05:12 kfzyqin

I fixed the issue by pip install deepspeed==0.14.4

kfzyqin avatar Dec 05 '24 06:12 kfzyqin

Hello, this problem should be due to the mismatch between the transformers version used and deepspeed version. If you want to use transformers version later than 4.37.2, deepspeed should also be upgraded.

czczup avatar Dec 08 '24 14:12 czczup