You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I pass inputs as (64, 60, 257) and (64, 257, 60, 1), the session runs fine.
But when I tried to pass inputs shaped as (32, 60, 257) and (32, 257, 60, 1), I get the following error:
RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running Reshape node.
Name:'StatefulPartitionedCall/model/1/Conv2D__36'
Status Message: /onnxruntime_src/onnxruntime/core/providers/cpu/tensor/reshape_helper.h:42
onnxruntime::ReshapeHelper::ReshapeHelper(const onnxruntime::TensorShape&, std::vector<long int>&) gsl::narrow_cast<int64_t>(input_shape.Size()) == size was false.
The input tensor cannot be reshaped to the requested shape. Input shape:{32,257,60,1}, requested shape:{64,1,257,60}
Urgency
I'm trying to keep up with my project deadline on Aug. 13.
System information
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Google Colab
Tensorflow version: 2.5
Python version: 3.7
Onnx runtime version: 1.6
Onnx version: 1.7
To Reproduce
Describe steps/code to reproduce the behavior. Please upload/link the model you are trying to convert if possible. model link
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
The error occurs in the first operation Reshape as shown in this picture
The reshape op is supposed to reshape input of (64, 257, 60, 1) into (64, 1, 257, 60).
But the error message says Input shape:{32,257,60,1}, requested shape:{64,1,257,60}, which means the tensor was not reshaped correctly.
The text was updated successfully, but these errors were encountered:
You can't just change the input shape by modifying the graph like that once it is converted. There can be many ops within the graph that depend on the input shape matching what was initially declared. You'll need to override the shape before converting to onnx. Can you edit the tf model signature? You can also override the shape with tf2onnx's --input flag use -1 to indicate unknown dims
Describe the bug
I have a trained Tensorflow model that has two inputs:
Then I converted it to ONNX model via tf2onnx with the command
and use it for inference with dynamic input shape by the following code:
My inference code:
If I pass inputs as (64, 60, 257) and (64, 257, 60, 1), the session runs fine.
But when I tried to pass inputs shaped as (32, 60, 257) and (32, 257, 60, 1), I get the following error:
Urgency
I'm trying to keep up with my project deadline on Aug. 13.
System information
To Reproduce
Describe steps/code to reproduce the behavior. Please upload/link the model you are trying to convert if possible.
model link
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
![Screen Shot 2021-08-03 at 11 31 36](https://user-images.githubusercontent.com/45028573/127955334-f39d544a-6006-4ed6-9065-bb11e4839afc.png)
The error occurs in the first operation
Reshape
as shown in this pictureThe reshape op is supposed to reshape input of (64, 257, 60, 1) into (64, 1, 257, 60).
But the error message says
Input shape:{32,257,60,1}, requested shape:{64,1,257,60}
, which means the tensor was not reshaped correctly.The text was updated successfully, but these errors were encountered: