tensorflow-onnx icon indicating copy to clipboard operation
tensorflow-onnx copied to clipboard

Multi Dimension Input

Open advian123 opened this issue 2 years ago • 4 comments

Question

Hi, I have tensorflow model pb file which is multidimensional input, how can I pass that as command line argument?

Further information

Input node name: TensorInput: 0 Input shape is [?, 1024, 1024, 3] , [?1024, 1024, 3]

I'm passing this as an argument: python -m tf2onnx.convert --saved-model test_model.pb --inputs TensorInput:0[[-1,1024,1024,3],[-1,1024,1024,3] --output model.onnx --outputs decoder:0

-1 because in readme it is written to us -1 for unknown dimension

advian123 avatar May 17 '23 16:05 advian123

@fatcat-z please help

advian123 avatar May 17 '23 16:05 advian123

-1 is designed for unknown (dynamic) dimensions. Not sure if this is what you need.

fatcat-z avatar May 23 '23 02:05 fatcat-z

Yes, I got that part that we have to use -1 for unknown dimension. I want to know how to specify in the command line for a multidimensional array which is like this: [-1, 1024, 1024, 3] , [-1,1024, 1024, 3].

I tried this: python -m tf2onnx.convert --saved-model test_model.pb --inputs TensorInput:0[[-1,1024,1024,3],[-1,1024,1024,3] --output model.onnx --outputs decoder:0

But it failed. @fatcat-z

advian123 avatar May 23 '23 11:05 advian123

What kind of errors you met? From my perspective, seems like there is 1 more unexpected '[' in your command. Could you please try the command below and share us the error you met?

python -m tf2onnx.convert --saved-model test_model.pb --inputs TensorInput:0[-1,1024,1024,3] --output model.onnx --outputs decoder:0

There is an example here which might help you a little.

fatcat-z avatar May 24 '23 16:05 fatcat-z