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
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)
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>.
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
The text was updated successfully, but these errors were encountered: