MPolaris / onnx2tflite

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

yolov5s.onnx转换tflite出错 #55

Closed crash-A closed 1 month ago

crash-A commented 11 months ago

这是我的转换代码 from converter import onnx_converter onnx_converter( onnx_model_path = "./yolov5s.onnx", need_simplify = True, output_path = "./", target_formats = ['tflite'], # or ['keras'], ['keras', 'tflite'] weight_quant = False, int8_model = False, int8_mean = None, int8_std = None, image_root = None ) 这是报错内容 Checking 0/1... INFO:deformation_layers ::Reshape will process tensor after change back to NCHW format. Traceback (most recent call last): File "e:\nncase\onnx2tflite-main\onnx2tflite-main\onnx2tflite.py", line 2, in onnx_converter( File "e:\nncase\onnx2tflite-main\onnx2tflite-main\converter.py", line 21, in onnx_converter keras_model = keras_builder(model_proto, native_groupconv) File "e:\nncase\onnx2tflite-main\onnx2tflite-main\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 "e:\nncase\onnx2tflite-main\onnx2tflite-main\layers\deformation_layers.py", line 140, in init end = start + node_attribute['split'][index] KeyError: 'split' 能麻烦看一下吗

shichaoya commented 8 months ago

这个问题有解决嘛,我也遇到了这个问题

MPolaris commented 7 months ago

额,你们可以debug一下这里,并自己修改一下。 如果还有问题,可以传一个onnx来我看看。