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

多gpu报错:Input tensor at index 2 has invalid shape #263

Open
tuzeao opened this issue Dec 26, 2022 · 0 comments
Open

多gpu报错:Input tensor at index 2 has invalid shape #263

tuzeao opened this issue Dec 26, 2022 · 0 comments

Comments

@tuzeao
Copy link

tuzeao commented Dec 26, 2022

python3.8,环境同requirements.txt
当使用多个gpu训练时候,会报错
RuntimeError: Input tensor at index 2 has invalid shape [2, 10, 12, 1024, 64], but expected [2, 11, 12, 1024, 64]

出错行显示在模型推理那行
outputs = model.forward(input_ids=batch_inputs, labels=batch_inputs)

这就很奇怪了,明明input_ids和labels完全是一个东西,却会报shape invalid

尝试性用了单gpu,发现代码能跑了

试了一些常规方法,没发现问题原因

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

1 participant