-
Notifications
You must be signed in to change notification settings - Fork 136
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
Is it possible to compile ONNX models? #59
Comments
Hello David, It is definitely possible to compile ONNX models. The particular model you are attempting to compile uncovered a few bugs on our end. Specifically:
Beyond these two issues, the particular pre-trained model mentioned may have problems. I’m not sure precisely from where you downloaded this model, but the resnet18v1 model from https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet18v1/resnet18v1.onnx appears to have incorrectly named operators and other issues (#59). Since you mentioned you just picked a random model, I did not spend too much time investigating. If using this specific model is important, could you attach the .onnx model you were using to this issue? That being said, here’s an example of compilation using resnet50 using the model at https://github.com/onnx/models/tree/master/vision/classification/resnet/resnet50.
Notice how the inputs and outputs are specified. For this model, the github page above conveniently specifies the input and output names and dimensions. For a more general ONNX model, you may find the net_drawer.py script provided by ONNX useful for visualizing the network.
Hopefully this helps. Please let us know if you experience any further issues. Regards, |
Just got around to testing your suggested solution, and I get the same error message with the resnet50 models as well (I tested all models from the link you gave - opset3 up to opset9) About ONNX versions - I have installed onnx 1.6.0 and onnxruntime 1.1.0 |
Hello David, After some debugging, it appears the issue may be related to onnx 1.6.0. I was able to reproduce the issue when using onnx 1.6.0, but compilation works fine when downgrading to 1.5.0.
I'll continue to investigate and try to figure out why onnx 1.6.0 is problematic. -Taylor |
Hello again David, I have some new information - the issue appears to be related to how the Onnx 1.6 binary wheel was compiled and the version of libprotobuf used. Looking at a corefile, I see the SEGFAULT coming from:
Notably, this file has a dependency on libprotobuf, and I've found some other github issues that alude to this file being sensitive to protobuf version.
I'm still investigating, but in the mean time if you do a source install of onnx then you ought to be able to use 1.6.
-Taylor |
Seems like the same issue: schyun9212/maskrcnn-benchmark#3 |
Thanks, that seems to solve the issue and enables me to run a sanity check of my setup. The actual model I'm trying to compile includes an Upsample op (which looks to be supported, based on ONNX supported ops) + I assume you support opset 9, since Upsample was deprecated in newer ONNX versions. For some reason the compilation now fails with: I've attached the log and a visualization of one of the Upsample modules in Netron, which is very simple: If needed, I can open an issue with AWS support and share additional data (ONNX file, compiler artifacts, etc..) |
Thanks David, I have opened an issue internally to track this error. We'll report back once we know more. Regards, |
David, could you please share the model with us? Full or a small version that contains the upsample operator. That will speed up our debug process. Thank you, |
Closing |
Release notes for Neuron SDK Release - August 5, 2020
There are mentions of this capability in some docs + list of supported ops, but there's no example of how to do it in practice.
I tried compiling a simple pretrained resnet model from https://github.com/onnx/models/ and it failed with:
The text was updated successfully, but these errors were encountered: