MPolaris / onnx2tflite

Tool for onnx->keras or onnx->tflite. Hope this tool can help you.
Apache License 2.0
526 stars 42 forks source link

Convert onnx with dynamic input shape #40

Closed alexg93333 closed 1 year ago

alexg93333 commented 1 year ago

I am running into this error. It would be great if somebody could help.

python3.10 converter.py --weights "./model.onnx" --formats "tflite" --int8

Checking 0/1... WARNING:onnx_loader running::onnxsim is failed, maybe make convert fails. Traceback (most recent call last): File "/home/dockerpaddle/Desktop/onnx2tflite/converter.py", line 108, in run() File "/home/dockerpaddle/Desktop/onnx2tflite/converter.py", line 92, in run onnx_converter( File "/home/dockerpaddle/Desktop/onnx2tflite/converter.py", line 21, in onnx_converter keras_model = keras_builder(model_proto, native_groupconv) File "/home/dockerpaddle/Desktop/onnx2tflite/utils/builder.py", line 82, in keras_builder tf_tensor[node_outputs[index]] = tf_operator(tf_tensor, onnx_weights, node_inputs, op_attr, index=index)(_inputs) File "/home/dockerpaddle/Desktop/onnx2tflite/layers/conv_layers.py", line 57, in init out_channel, in_channel = node_weights[node_inputs[1]].shape[:2] KeyError: 'conv2d_0.w_0'

MPolaris commented 1 year ago

Can you share onnx to me? I need more information about model to fix this error.

MPolaris commented 1 year ago

fixed, please pull latest code and try again