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

null_loss问题:标签值超出了类别范围? #69023

Open
GaeHyo opened this issue Oct 29, 2024 · 3 comments
Open

null_loss问题:标签值超出了类别范围? #69023

GaeHyo opened this issue Oct 29, 2024 · 3 comments
Assignees
Labels

Comments

@GaeHyo
Copy link

GaeHyo commented Oct 29, 2024

请提出你的问题 Please ask your question

任务日志如下:
File "/root/paddlejob/workspace/code/main.py", line 458, in
main()
File "/root/paddlejob/workspace/code/main.py", line 150, in main
train(train_loader, model, criterion, optimizer, epoch, normalizer)
File "/root/paddlejob/workspace/code/main.py", line 206, in train
loss = criterion(output, target_var)
File "/home/aistudio/.local/lib/python3.10/site-packages/paddle/nn/layer/layers.py", line 1429, in call
return self.forward(*inputs, **kwargs)
File "/home/aistudio/.local/lib/python3.10/site-packages/paddle/nn/layer/loss.py", line 921, in forward
return F.nll_loss(
File "/home/aistudio/.local/lib/python3.10/site-packages/paddle/nn/functional/loss.py", line 1448, in nll_loss
out, total_weight = _C_ops.nll_loss(
ValueError: (InvalidArgument) label should not be out of bounds.
[Hint: Expected cur_label >= 0 && cur_label < n_classes == true, but received cur_label >= 0 && cur_label < n_classes:0 != true:1.] (at /paddle/paddle/phi/kernels/cpu/nll_loss_kernel.cc:68)

/mnt
[INFO]: size checker 352 finished

本地demo已跑通,在ai studio上报错
本地paddle版本:paddle 3.0 beta1

@GaeHyo
Copy link
Author

GaeHyo commented Nov 1, 2024

请问有人负责解答吗?

@TingquanGao
Copy link

可以提供下复现命令吗?

@GaeHyo
Copy link
Author

GaeHyo commented Nov 8, 2024

cgcnn-paddle.zip

本地环境:
python 3.10
paddle 3.0.0
cuda 12.3

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

No branches or pull requests

2 participants