-
Notifications
You must be signed in to change notification settings - Fork 99
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
Model with dynamic dimensions #22
Comments
Thanks for trying this out! Sorry for the delay, I moved recently and don't have as much free time as I would like. I tried it and see the same problem. I'll see if I can do something about it. |
Thanks, no problem. I'm using the onnxruntime Python bindings with PyO3 for now so this isn't blocking for me :) |
I am taking a look at this and I have some questions. If I print the inputs from python: for idx, inputs in enumerate(session.get_inputs()):
print("idx:", idx)
print(" Name:", inputs.name)
print(" Shape:", inputs.shape) I get this:
I guess I can assume that the python lib interprets the |
Investigating this, I found a bug related to the inputs. Multiple inputs, like in your example, should be treated as inputs to the model that should be used together, not as a list to loop over to perform inference. So this loop is wrong: https://github.com/nbigaouette/onnxruntime-rs/blob/751d996/onnxruntime/src/session.rs#L355-L404 Thanks!! :D |
Can you take a look at branch It needs cleanup but it is able to load your model and seems to correctly perform inference with it. Feel free to comment there! |
Hi, sorry, was a bit busy. I assume the questions from your first comment are resolved? If not, there's more info here and in the onnx.proto file, but I don't know where exactly the names are stored either. Thanks for the fix, I'll have a look! |
I ran into another issue trying to set up the branch:
[package]
name = "onnxruntimerstest"
version = "0.1.0"
authors = ["Benjamin Minixhofer <[email protected]>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
onnxruntime = { git = "https://github.com/nbigaouette/onnxruntime-rs", branch = "issue22" }
The same seems to be happening with version 0.0.8:
[package]
name = "onnxruntimerstest"
version = "0.1.0"
authors = ["Benjamin Minixhofer <[email protected]>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
onnxruntime = "0.0.8" Maybe something to do with onnxruntime v1.5.1 (released 6 days ago) ? |
Yeah I don't understand why this fails. I have the same issue in the branch's CI. Downloading the archive has been working for some time, but then I get a 404. It might be caused by the new release as you suggested, but it's weird. You can try to download the archive manually and extract it somewhere. Then use |
Regarding the 404 failure, it was a bug in |
Hi, thanks for this library!
I've been trying to run a model with dynamic input dimensions, but it doesn't work due to a
NonMatchingDimensions
error.model here.
Here's how I'd use the model from the onnxruntime Python bindings:
Using your Rust bindings:
This prints:
Apparently the dynamic dimensions lead to an integer overflow (they are encoded as -1 in ONNX iirc).
I'm also a bit skeptical about the constraint on
.run
to have the same output type as input type - does that handle models with int64 input and float output correctly?I appreciate any help!
The text was updated successfully, but these errors were encountered: