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

Assertion p_in_data[idx] >= 0 && p_in_data[idx] < depth failed. Illegal index value, Input(input) value should be greater than or equal to 0, and less than depth [2], but received [0]. #3684

Open
1 task done
monsterlyg opened this issue Mar 28, 2024 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@monsterlyg
Copy link

问题确认 Search before asking

  • 我已经搜索过问题,但是没有找到解答。I have searched the question and found no related answer.

请提出你的问题 Please ask your question

Error: ../paddle/phi/kernels/gpu/one_hot_kernel.cu:37 Assertion p_in_data[idx] >= 0 && p_in_data[idx] < depth failed. Illegal index value, Input(input) value should be greater than or equal to 0, and less than depth [2], but received [0].
Error: ../paddle/phi/kernels/gpu/one_hot_kernel.cu:37 Assertion p_in_data[idx] >= 0 && p_in_data[idx] < depth failed. Illegal index value, Input(input) value should be greater than or equal to 0, and less than depth [2], but received [0].
Traceback (most recent call last):
File "/ssd2/lyg/code/baidu/third-party/paddle-seg/tools/train.py", line 194, in
main(args)
File "/ssd2/lyg/code/baidu/third-party/paddle-seg/tools/train.py", line 173, in main
train(
File "/ssd2/lyg/code/baidu/third-party/paddle-seg/paddleseg/core/train.py", line 194, in train
loss_list = loss_computation(
File "/ssd2/lyg/code/baidu/third-party/paddle-seg/paddleseg/core/train.py", line 50, in loss_computation
loss_list.append(losses['coef'][i] * loss_i(logits, labels))
File "/root/anaconda3/lib/python3.9/site-packages/paddle/nn/layer/layers.py", line 1254, in call
return self.forward(*inputs, **kwargs)
File "/ssd2/lyg/code/baidu/third-party/paddle-seg/paddleseg/models/losses/mixed_loss.py", line 56, in forward
output = loss(logits, labels)
File "/root/anaconda3/lib/python3.9/site-packages/paddle/nn/layer/layers.py", line 1254, in call
return self.forward(*inputs, **kwargs)
File "/ssd2/lyg/code/baidu/third-party/paddle-seg/paddleseg/models/losses/lovasz_loss.py", line 52, in forward
vprobas, vlabels = flatten_probas(probas, labels, self.ignore_index)
File "/ssd2/lyg/code/baidu/third-party/paddle-seg/paddleseg/models/losses/lovasz_loss.py", line 218, in flatten_probas
indexs = paddle.nonzero(valid_mask)
File "/root/anaconda3/lib/python3.9/site-packages/paddle/tensor/search.py", line 433, in nonzero
outs = _C_ops.nonzero(x)
OSError: (External) CUDA error(719), unspecified launch failure.
[Hint: 'cudaErrorLaunchFailure'. An exception occurred on the device while executing a kernel. Common causes include dereferencing an invalid device pointerand accessing out of bounds shared memory. Less common cases can be system specific - more information about these cases canbe found in the system specific user guide. This leaves the process in an inconsistent state and any further CUDA work willreturn the same error. To continue using CUDA, the process must be terminated and relaunched.] (at ../paddle/phi/backends/gpu/cuda/cuda_info.cc:260)

就是两个类别,标签是0,居然还提示错误。。。

@monsterlyg monsterlyg added the question Further information is requested label Mar 28, 2024
@shiyutang
Copy link
Collaborator

你好,看上去是one-hot op存在问题,请前往**官网**提问或者切换其他常用损失。

@pobi123
Copy link

pobi123 commented Apr 26, 2024

你好,请问你这个问题解决了吗?我也遇到了这个问题。

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

No branches or pull requests

3 participants