get tensor value: model/inference/Max_1 must be Const

Describe the bug

I have noticed that xxx must be const is a known issue, but I also found a PR which says ONNX has supported dynamic padding, but I still got the following error:

OP=Pad
Name=some/path/to/op/Pad
Inputs:
        some/path/to/op/concat:0=Concat, [-1, -1], 1
        some/path/to/op/Pad/paddings_Concat__113:0=Concat, [2, 2], 6
Outpus:
        some/path/to/op/Pad:0=[-1, -1], 1
Traceback (most recent call last):
  File "D:\Python\Python36\lib\site-packages\tf2onnx\tfonnx.py", line 352, in tensorflow_onnx_mapping
    func(g, node, **kwargs)
  File "D:\Python\Python36\lib\site-packages\tf2onnx\onnx_opset\nn.py", line 401, in version_1
    paddings = np.array(node.inputs[1].get_tensor_value()).transpose().flatten()
  File "D:\Python\Python36\lib\site-packages\tf2onnx\graph.py", line 256, in get_tensor_value
    raise ValueError("get tensor value: {} must be Const".format(self.name))
ValueError: get tensor value: some/path/to/op/Pad/paddings_Concat__113 must be Const
2019-11-21 15:52:39,788 - VERBOSE - tf2onnx.tfonnx: Mapping TF node to ONNX node(s)
2019-11-21 15:52:40,098 - ERROR - tf2onnx.tfonnx: Failed to convert node some/path/to/op/Fill

Does tf2onnx plan to support dynamic padding?

System information

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Win10
Tensorflow Version: 1.13.1
Python version: 3.6.6
ONNX: 1.6.0
ONNXRUNTIME: 1.1.10
tf2onnx: 1.5.3

try --opset 11 in the command line.
We have not pushed this to pypi yet so you’d need to user master.

参考:
https://github.com/onnx/tensorflow-onnx/issues/655
https://github.com/onnx/tensorflow-onnx/issues/746

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值