-
Notifications
You must be signed in to change notification settings - Fork 62
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
[OSX] [Resnet18] Parameter replacement usage #399
Comments
It was not clear to me why parameter substitution was necessary. It just fixes the batch size. onnx2tf -i resnet18-v1-7.onnx -cotof -b 1
|
Thanks for the fast reply. Fixing the batch size did not fix it for me somehow.
|
It is a problem specific to your environment.
To begin with, your log shows that the conversion was successful. https://n.ethz.ch/~qifeng/download/log.txt There is an error in the version of the tools you reported at the beginning of this issue. Perhaps there is a problem with onnxruntime. I will not investigate environment specific issues. If you cannot solve the problem on your own, you should use Docker. |
Thanks a lot! I'll look into it. |
Update: problem resolved after moving from osx to linux system (in case anyone is having the same issue). |
Seems to be a bug in onnxruntime for OSX or TensorFlow. |
Ah I figured out what the problem was. I changed |
Issue Type
Documentation Feature Request, Others
onnx2tf version number
1.13.12
onnx version number
1.13.1
onnxruntime version number
1.15.0
onnxsim (onnx_simplifier) version number
0.4.17
tensorflow version number
2.13.0rc0
Download URL for ONNX
https://github.com/PINTO0309/onnx2tf/releases/download/0.0.2/resnet18-v1-7.onnx
Parameter Replacement JSON
Description
I tried running
onnx2tf -i resnet18-v1-7.onnx -cotof
oronnx2tf -i resnet18-v1-7.onnx -ois data:1,3,224,224
oronnx2tf -i resnet18-v1-7.onnx -ois data:1,3,224,224 -prf replace.json
. Attached is the original onnx graph for resnet18 and the converted tflite-float32 graph respectivelyIt looks like the problem is caused by the conversion from
GlobalAveragePool
toReduceMean
being applied to the wrong axis.The output of running
onnx2tf -i resnet18-v1-7.onnx -cotof
is attached hereHow: So I tried resolving it with using
replace.json
. However, it's not very successful and I suspect that it's due to me supplying the wrongop_name
. I have triedMean__34
andresnetv15_pool1_fwd/Mean
. This might be a really stupid question: where should I look to find the correctop_name
especially in this case the onnx operation is converted to a few different tf operations?Why: I would really like to figure out how to use the package properly so I can convert my other pytorch models to tflite for deploying on edge devices.
Resources: the example parameter replacement json in documentation
The text was updated successfully, but these errors were encountered: