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

在colab运行gpt微调时遇到错误 RuntimeError: Index tensor must have the same number of dimensions as self tensor #1926

Closed
AmemiaErika opened this issue Jan 7, 2025 · 2 comments

Comments

@AmemiaErika
Copy link

[rank0]:   File "/usr/local/lib/python3.9/site-packages/torchmetrics/functional/classification/stat_scores.py", line 364, in _refine_preds_oh
[rank0]:     return torch.zeros_like(preds_oh, dtype=torch.int32).scatter_(-1, result.unsqueeze(1).unsqueeze(1), 1)
[rank0]: RuntimeError: Index tensor must have the same number of dimensions as self tensor
@yangjianxie
Copy link

我也遇到了这个问题

@yangjianxie
Copy link

我刚遇到这个问题...试了一下解决了。
方法是:
pip install torchmetrics==1.5

从另一个issue中看到的解决方法,我试了下可以

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