weixin_43978059 2022-03-12 13:57 采纳率: 0%
浏览 675
已结题

(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条回答 默认 最新

  • Mr.郑先生_ 2022-03-12 15:04
    关注

    您好,您改的思路不太对,可以检查一下.yml配置文件里损失函数的配置

    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 5月22日
  • 专家修改了标签 3月12日
  • 创建了问题 3月12日

悬赏问题

  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作