PaddleSeg
PaddleSeg copied to clipboard
关于label维度和logit维度不一致的问题
在使用自己数据进行训练的时候,发现报错 [Hint: Expected labels_dims[axis] == 1UL, but received labels_dims[axis]:3 != 1UL:1.] 猜测是label图片读取的时候,通道数为3,查了下dataset.py和transforms.py的代码,在Compose这个类中,关于label图片的读取是 label = np.asarray(Image.open(label)) 改成 label = cv2.imwrite(label, cv2.IMREAD_GRAYSCALE) 此时报错解除,但不确定是否有效 不知道是我的图片的问题还是哪里不对
@ww451575464 Hi, yes, your label format is wrong. It should be a single channel.
I have the same issue . Can you please be more specific on which .py files you changed? I can't seem to find it. Thanks!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
生成蒙版要是: cv2.imwrite('Annotations/'+(imagName),np_img),不能是:cv2.imwrite('okMask/'+(imagName), cv2.cvtColor(np_img, cv2.COLOR_RGB2BGR) )