Skip to content
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

Expected onnx model input mismatch with name in test_onnx.py #143

Open
norbertlink opened this issue Aug 2, 2024 · 1 comment
Open

Expected onnx model input mismatch with name in test_onnx.py #143

norbertlink opened this issue Aug 2, 2024 · 1 comment

Comments

@norbertlink
Copy link

When trying test_onnx.py with the model from https://huggingface.co/onnx-community/metric3d-vit-large I got the following error: ValueError: Required inputs (['pixel_values']) are missing from input feed (['image'])
due to mismatch between the onnx_input dictionary used in the script and the input dictionary expected by the model.
Changing the key name from "image" to "pixel_values" in the code below will solve the issue.
onnx_input = {
"image": np.ascontiguousarray(
np.transpose(rgb, (2, 0, 1))[None], dtype=np.float32
), # 1, 3, H, W
}
to
onnx_input = {
"pixel_values": np.ascontiguousarray(
np.transpose(rgb, (2, 0, 1))[None], dtype=np.float32
), # 1, 3, H, W
}

@JUGGHM
Copy link
Collaborator

JUGGHM commented Aug 16, 2024

Thanks for your sincere report and I will update this in ReadMe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants