Closed mrgloom closed 5 years ago
Some models specify placeholders with unknown ranks and dims which can not be mapped to onnx. In those cases one can add the shape behind the input name in [], for example --inputs X:0[1,28,28,3]
I assume this is no longer an issue.
Some models specify placeholders with unknown ranks and dims which can not be mapped to onnx. In those cases one can add the shape behind the input name in [], for example --inputs X:0[1,28,28,3]
What if the rank is known, but the batchsize, height and width in NHWC(C=3) are unknown? Is it possible to add the shape behind the input name in [], for example -- inputs X:0[-1,-1,-1,3]? I did converted a .pb model to a .onnx model with the input share=[?x224x224x3], but in this case, I have no idea how to convert it.
We support adding the shape behind the input but the way the regex is the -1 would not work. We can change it to support -1. Depends on the model if this works since we sometimes need to know the shape to calculate attributes. opset-11 or better makes us depend less on knowing the shape.
python -m tf2onnx.convert --input ./faceboxes_feature_extractor.pb --output ./faceboxes_feature_extractor.onnx --inputs image_tensor:0 --outputs prediction_layers/box_encoding_predictor_0/BiasAdd:0
Looking at output of
summarize_graph
:So looks like it can't estimate shape of input placeholder, but how can I specify it?
In code it's: https://github.com/onnx/tensorflow-onnx/blob/master/tf2onnx/shape_inference.py#L106 https://github.com/onnx/tensorflow-onnx/blob/master/tf2onnx/shape_inference.py#L114