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