PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
21.63k stars 5.44k forks source link

Assertion `p_in_data[idx] >= 0 && p_in_data[idx] < depth` failed. #63882

Closed pobi123 closed 1 week ago

pobi123 commented 1 week ago

bug描述 Describe the Bug

I got an error while using paddleseg for semantic segmentation training. Error: C:\home\workspace\Paddle\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 [20], but received [20].

My dataset has 7910 images, using grayscale annotations, with a total of 20 labels (including background classes).

Here is my environment configuration: cuda 11.6 cudnn 8.4.0 python 3.8.0 paddlapddle 2.5.2 paddleseg 2.9

Can someone help me?

其他补充信息 Additional Supplementary Information

No response

BiynXu commented 1 week ago

Can you please provide reproduction scripts?

pobi123 commented 1 week ago

Can you please provide reproduction scripts?

thank you. I've solved the problem. It is caused by the change of pixel value of some pixel points caused by interpolation algorithm during image geometry transformation.