Paddle报错的解决方案(持续更新)

问题一 self.output = paddle.layer.fc( input=[self.linear_part, self.interaction_part], size=1, act=paddle.activation.Sigmoid(), param_attr=paddle.attr.Par...
摘要由CSDN通过智能技术生成

问题一

 self.output = paddle.layer.fc(
            input=[self.linear_part, self.interaction_part],
            size=1,
            act=paddle.activation.Sigmoid(),
            param_attr=paddle.attr.ParamAttr(
                name="%s_fc_output_linear_part.w" % self.network_name,
                is_static=is_subnet_param_static,
                l2_rate=self.l2_rate,
            ),
            bias_attr=paddle.attr.ParamAttr(
                name="%s_fc_output_linear_part.b" % self.network_name,
                is_static=is_subnet_param_static,
                l2_rate=self.l2_rate,
            )
        )

报错如下:

File "/python/lib/python2.7/site-packages/paddle/trainer/config_parser.py", line 4341, in my_fatal
raise Exception()

原因如下:
When the name field of param_attr is manually specified and the input is a list, the param_attr should also be a list with each item being the param_attr for each input item. If only one named param_attr is provided, all the input items would share this parameter.
但由于fc_layer的更新,使得不能默认的共享参数,导致报错。

解决方法:
若代码设定param_attr,而input是个list,param_attr也设置成list,即可解决。

参考:
https://github.com/PaddlePaddle/models/issues/512

问题二

报错如下:

File "/python
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值