onnx2tflite icon indicating copy to clipboard operation
onnx2tflite copied to clipboard

yolov5s.onnx转换tflite出错

Open crash-A opened this issue 2 years ago • 2 comments

这是我的转换代码 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' 能麻烦看一下吗

crash-A avatar Sep 25 '23 11:09 crash-A

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

shichaoya avatar Jan 09 '24 11:01 shichaoya

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

MPolaris avatar Jan 26 '24 02:01 MPolaris