PaddleSeg icon indicating copy to clipboard operation
PaddleSeg copied to clipboard

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].

Open monsterlyg opened this issue 1 year ago • 2 comments

问题确认 Search before asking

  • [X] 我已经搜索过问题,但是没有找到解答。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 avatar Mar 28 '24 09:03 monsterlyg

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

shiyutang avatar Apr 11 '24 12:04 shiyutang

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

pobi123 avatar Apr 26 '24 02:04 pobi123