MPolaris / onnx2tflite

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

FastestDet onnx转tflite/keras失败 #22

Closed zi-niu closed 1 year ago

zi-niu commented 1 year ago

FastestDet链接[https://github.com/dog-qiuqiu/FastestDet]

onnxsim is failed, maybe make convert fails. [0] redundant input nodes are removed. nodes name : Traceback (most recent call last): File "C:\Users\Ziniu\Desktop\onnx2tflite-main\converter.py", line 70, in run() File "C:\Users\Ziniu\Desktop\onnx2tflite-main\converter.py", line 55, in run onnx_converter( File "C:\Users\Ziniu\Desktop\onnx2tflite-main\converter.py", line 18, in onnx_converter keras_model = keras_builder(model_proto, input_node_names, output_node_names) File "C:\Users\Ziniu\Desktop\onnx2tflite-main\utils\builder.py", line 103, in keras_builder tf_tensor[node_outputs[index]] = tf_operator(tf_tensor, onnx_weights, node_inputs, op_attr, index=index)(_inputs) File "C:\Users\Ziniu\Desktop\onnx2tflite-main\layers\conv_layers.py", line 80, in call return self.conv(inputs) File "C:\Users\Ziniu\Desktop\onnx2tflite-main\layers\conv_layers.py", line 119, in call return self.conv(inputs) File "C:\Users\Ziniu\AppData\Roaming\Python\Python39\site-packages\keras\utils\traceback_utils.py", line 70, in error_handler raise e.with_traceback(filtered_tb) from None File "C:\Users\Ziniu\AppData\Roaming\Python\Python39\site-packages\keras\initializers\initializers_v2.py", line 265, in call return tf.constant(self.value, dtype=_get_dtype(dtype), shape=shape)

附onnx文件: FastestDet.zip

MPolaris commented 1 year ago

这个模型有点难搞,你可以试着针对这个模型改写一下gather的逻辑。 目前我也没时间去修复这个BUG。