您当前的位置: 首页 >  ar
  • 0浏览

    0关注

    2393博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

成功解决TypeError: Value passed to parameter 'paddings' has DataType float32 not in list of allowed valu

一个处女座的程序猿 发布时间:2018-10-04 15:47:22 ,浏览量:0

成功解决TypeError: Value passed to parameter 'paddings' has DataType float32 not in list of allowed valu

 

目录

解决问题

解决思路

解决方法

 

 

解决问题

TypeError: Value passed to parameter 'paddings' has DataType float32 not in list of allowed values: int32, int64

 

解决思路

类型错误:传递给参数“paddings”的值,不包含允许的值列表中的数据类型, int32, int64,这两种类型 对类型进行转换:强制转换为int类型

 

解决方法

建议采用np的int类型转换!

 x_padded = tf.pad(x, [[0, 0], [np.int(kernel / 2), np.int(kernel / 2)], [np.int(kernel / 2), np.int(kernel / 2)], [0, 0]], mode=mode) 

哈哈,成功运行,大功告成!

 

 

 

 

 

 

 

关注
打赏
1664196048
查看更多评论
立即登录/注册

微信扫码登录

0.0445s