Skip to content

ms-swfit 微调qewn2.5-vl 报错 IndexError: index 4247 is out of bounds for dimension 0 with size 4247 #3902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Oukaishen opened this issue Apr 16, 2025 · 1 comment

Comments

@Oukaishen
Copy link

Oukaishen commented Apr 16, 2025

Describe the bug
What the bug is, and how to reproduce, better with screenshots(描述bug以及复现过程,最好有截图)

SFT qwen2.5-vl在某些corner-case情况下报错

swift sft
--model XXXX/qwen/Qwen2.5-VL-3B-Instruct
--dataset XXX/train.json
--train_type full
--torch_dtype bfloat16
--truncation_strategy right
--deepspeed zero3
--freeze_vit true
--num_train_epochs 1
--per_device_train_batch_size 1
--per_device_eval_batch_size 1
--learning_rate 1e-5
--gradient_accumulation_steps 4
--max_new_tokens 32
--eval_steps 2000
--save_steps 2000
--save_total_limit 10
--logging_steps 10
--max_length 4096
--output_dir output
--warmup_ratio 0.05
--dataloader_num_workers $GPUS_PER_NODE

Your hardware and system info
Write your system info like CUDA version/system/GPU/torch version here(在这里给出硬件信息和系统信息,如CUDA版本,系统,GPU型号和torch版本等)

GPU - H20 X 8

ms_swift 3.3.0.post1
transformers 4.49.0
transformers-stream-generator 0.0.5
nvidia-cuda-cupti-cu12 12.4.127
nvidia-cuda-nvrtc-cu12 12.4.127
nvidia-cuda-runtime-cu12 12.4.127
torch 2.5.1
torchvision 0.20.1
qwen-vl-utils 0.0.10

Additional context
Add any other context about the problem here(在这里补充其他信息)

Image

IndexError: index 4247 is out of bounds for dimension 0 with size 4247

@Jintao-Huang
Copy link
Collaborator

please remove --truncation_strategy right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants