Skip to content
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

RuntimeError: The expanded size of the tensor (10) must match the existing size (11) at non-singleton dimension 0 #42

Open
Mrkkew opened this issue Feb 19, 2025 · 1 comment

Comments

@Mrkkew
Copy link

Mrkkew commented Feb 19, 2025

开始运行之后,报如下的错误:
[rank3]: return inner_training_loop(
[rank3]: File "/home/jovyan/work/tanzichang/miniconda/envs/vl_vllm/lib/python3.10/site-packages/transformers/trainer.py", line 2531, in _inner_training_loop
[rank3]: tr_loss_step = self.training_step(model, inputs, num_items_in_batch)
[rank3]: File "/home/jovyan/work/tanzichang/miniconda/envs/vl_vllm/lib/python3.10/site-packages/transformers/trainer.py", line 3675, in training_step
[rank3]: loss = self.compute_loss(model, inputs, num_items_in_batch=num_items_in_batch)
[rank3]: File "/home/jovyan/work/tanzichang/miniconda/envs/vl_vllm/lib/python3.10/site-packages/trl/trainer/grpo_trainer.py", line 495, in compute_loss
[rank3]: rewards_per_func[:, i] = torch.tensor(output_reward_func, dtype=torch.float32, device=device)
[rank3]: RuntimeError: The expanded size of the tensor (10) must match the existing size (11) at non-singleton dimension 0. Target sizes: [10]. Tensor sizes: [11]
请问是怎么回事?

@anine09
Copy link
Contributor

anine09 commented Feb 25, 2025

Hi @Mrkkew ,你运行的是哪个版本,是 DeepSpeed 版还是 Unsloth 版

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