question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Errors when loading saved onnx files

See original GitHub issue

We have an issue with saving and loading onnx files. When passing the generated quant_model_paths to get_onnx_runtime_sessions everything works okay but if I save the file and then run get_onnx_runtime_sessions on the loaded quantized files the model throws an error:

File "/Users/itai/Code/email-cleaner/.venv/lib/python3.7/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 184, in run
    raise ValueError("Model requires {} inputs. Input Feed contains {}".format(num_required_inputs, num_inputs))
ValueError: Model requires 3 inputs. Input Feed contains 2

This doesn’t seem to happen on SageMaker but it happens on mac and also on linux containerized environment.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
itaimcommented, Dec 19, 2021

Yes it does! Thank you very much!

1reaction
sidsharma72commented, Feb 9, 2022

I was facing the same issue - the resolution lies in the order of the quantized model paths. It should be encoder, decoder, init-decoder.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when checking model with external data #3598 - GitHub
I saved a simple model with save_as_external_data=True, then load the model into memory with load_external_data=False, will get an error ...
Read more >
OpenCV: Error in loading Net from onnx file - Stack Overflow
I'm trying to load with cv.dnn.readNetFromONNX a pre-trained torch model (U2Net to be precise) saved as onnx . But I'm receiving the error:...
Read more >
Troubleshoot - Hugging Face
Troubleshoot. Sometimes errors occur, but we are here to help! This guide covers some of the most common issues we've seen and how...
Read more >
Exporting your model to ONNX format - Unity - Manual
Blog post on saving, loading and inferencing from TensorFlow frozen graph. This is a simplified example: First save your TensorFlow to .pd format....
Read more >
Import pretrained ONNX network - MathWorks
This MATLAB function imports a pretrained ONNX (Open Neural Network Exchange) network from the file modelfile.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found