Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Exception encountered when calling layer "166_CHW" (type Lambda). #136

Open
Akotkar23 opened this issue Dec 7, 2021 · 0 comments

Comments

@Akotkar23
Copy link

I am trying to convert ONNX model to Keras, but while converting getting the following error: ValueError: Exception encountered when calling layer "166_CHW" (type Lambda).
Code
`import onnx
from onnx2keras import onnx_to_keras

Load ONNX model

onnx_model = onnx.load('best.onnx')

Call the converter (input - is the main model input name, can be different for your model)

k_model = onnx_to_keras(onnx_model, ['images'])
`
Error trace:
ValueError: Exception encountered when calling layer "166_CHW" (type Lambda).

Dimension 0 in both shapes must be equal, but are 639 and 638. Shapes are [639,638] and [638,638]. for '{{node 166_CHW/concat}} = ConcatV2[N=4, T=DT_FLOAT, Tidx=DT_INT32](Placeholder, Placeholder_1, Placeholder_2, Placeholder_3, 166_CHW/concat/axis)' with input shapes: [?,3,639,639], [?,3,638,639], [?,3,639,638], [?,3,638,638], [] and with computed input tensors: input[4] = <1>.

Call arguments received:
• inputs=['tf.Tensor(shape=(None, 3, 639, 639), dtype=float32)', 'tf.Tensor(shape=(None, 3, 638, 639), dtype=float32)', 'tf.Tensor(shape=(None, 3, 639, 638), dtype=float32)', 'tf.Tensor(shape=(None, 3, 638, 638), dtype=float32)']
• mask=None
• training=None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant