weixin_43978059
2022-03-12 13:57
采纳率: 0%
浏览 116

(InvalidArgument) Input(X) and Input(Label) shall have the same shape except the last dimension.

环境paddleseg2.3 paddle2.2.1
输入图像为两图像叠加成6通道的图像,标签图为单通道。使用unet++可以正常运行,使用unet3+报错。最初报错为
RuntimeError: The length of logits_list should equal to the types of loss config: 5 != 1.
我把paddleseg.core.train文件中第193行的logits_list = logits_list改为logits_list = [logits_list]报错
'list' object has no attribute 'shape'
于是在bceloss文件中增加
label = paddle.to_tensor(label)
logit = paddle.to_tensor(logit)
接着报错ValueError: (InvalidArgument) Input(X) and Input(Label) shall have the same shape except the last dimension. But received: the shape of Input(X) is [5, 1, 2, 512, 512], the shape of Input(Label) is [1, 1, 1, 512, 512].
不知道该从哪再改

1条回答 默认 最新

相关推荐 更多相似问题