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

The gpu cannot be used after model conversion #58

Closed yuqilol closed 9 months ago

yuqilol commented 10 months ago

Hello, I used my onnx model to convert into your tflite model, but after the conversion, the model can use CPU but not GPU, and there is a warning in the conversion process. Checking 0/1... INFO:deformation_layers ::Reshape will process tensor after change back to NCHW format. INFO:deformation_layers ::Reshape will process tensor after change back to NCHW format. INFO:deformation_layers ::Reshape will process tensor after change back to NCHW format. INFO:deformation_layers ::Reshape will process tensor after change back to NCHW format. INFO:deformation_layers ::Reshape will process tensor after change back to NCHW format. INFO:deformation_layers ::Reshape will process tensor after change back to NCHW format. INFO:tensorflow:Assets written to: C:\Users\Admin\AppData\Local\Temp\tmpae80la\assets INFO:tensorflow:Assets written to: C:\Users\Admin\AppData\Local\Temp\tmpae80la\assets WARNING:converter running::convert is successed, but model running is failed, please check carefully!

MPolaris commented 10 months ago

Some operators are not support on tflite-gpu, or maybe there are some issues with onnx2tflite. If it is the former, please simplify your ONNX model and remove unimportant non computational operators, such as the post-processing part of yolov5. If it is the latter, I hope you can provide a PR to onnx2tflite after resolving it.