-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ONNX to TFLite] Cannot reshape from slice to unsqueeze. #637
Comments
The structure of the ONNX file is broken before it can be converted by onnx2tf. Models that cannot be inferenced with onnxruntime should not be used.
|
Thanks for analysis and reply. Does this mean I do something wrong when export to ONNX model from pytorch? It's upset that seems I have to check more on ONNX details to realize where cause the issues. If it's not too much trouble, please give hints or guide if you probably knew or saw this kind of errors before. |
Hi, sorry for late to response. |
If you share only .pth with me, I can't advise you on anything. Because the problem is the design of the model you used for your training. The For example, statements such as I assure you. Models with Frankly, it's quite a hassle to have to imagine everything and deal with you. I am not a free PyTorch advisor. |
Hi, PINTO0309, certainly you don't have to do so much. I am always appreciated to people who are willing to share and guide. |
Issue Type
Others
OS
Windows
onnx2tf version number
1.20.0
onnx version number
1.16,0
onnxruntime version number
1.17.1
onnxsim (onnx_simplifier) version number
0.4.33
tensorflow version number
2.13.0
Download URL for ONNX
https://drive.google.com/file/d/1RQ-hO8f9UIGvrSLVv2SCvCFXVSA1zJ2H/view?usp=drive_link
Parameter Replacement JSON
Description
model = onnx.load(ONNXmodel_PATH)
chkResults = onnx.checker.check_model(model)
onnx2tf.convert(input_onnx_file_path=ONNXmodel_PATH,
output_folder_path=ConvertH5model_PATHROOT,
copy_onnx_input_output_names_to_tflite=True,
# param_replacement_file=PROJ_PATH + r'\outputs\replace.json'
)
ERROR message
I tried to change "slice" dimension while not help. It seems my realization might be incorrect.
I thought I correctly export Onnx model since onnx.checker.check_model is passed.
Hugging face has the tflite format, and it's not rewrite by tensorflow framework,
So I thought it should take benefit from onnx conversion.
Original I tried onnx-tensorflow(onnx_tf.backend) and it failed, then I found here and this approach seems more flexible and compatible, so I am really wondering I can correct use and make it work since I have several pytorch model needs to deploy with Tflite model.
Thanks for your patience.
I will be looking forward your guide to correctly convert ONNX to TFLite.
The text was updated successfully, but these errors were encountered: