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

Add validation of input shape during onnx model inference #385

Closed
ermolenkodev opened this issue May 26, 2022 · 0 comments
Closed

Add validation of input shape during onnx model inference #385

ermolenkodev opened this issue May 26, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ermolenkodev
Copy link
Collaborator

Currently, if an onnx model requires a 3-channel image but the input provided has only one channel internal onnx library exception will be thrown.

ai.onnxruntime.OrtException: Shape [1, 512, 512, 3], requires 786432 elements but the buffer has 262144 elements.

@ermolenkodev ermolenkodev added the enhancement New feature or request label May 26, 2022
@ermolenkodev ermolenkodev added this to the 0.5 milestone Sep 21, 2022
@ermolenkodev ermolenkodev self-assigned this Oct 11, 2022
ermolenkodev added a commit to ermolenkodev/KotlinDL that referenced this issue Oct 11, 2022
* Check if the number of elements in the input matches the model's input shape

* Trying to guess if the user used a grayscale image when 3-channels expected
ermolenkodev added a commit to ermolenkodev/KotlinDL that referenced this issue Oct 11, 2022
* Check if the number of elements in the input matches the model's input shape

* Trying to guess if the user used a grayscale image when 3-channels expected
ermolenkodev added a commit to ermolenkodev/KotlinDL that referenced this issue Oct 13, 2022
* Check if the number of elements in the input matches the model's input shape

* Trying to guess if the user used a grayscale image when 3-channels expected
ermolenkodev added a commit that referenced this issue Oct 13, 2022
* Check if the number of elements in the input matches the model's input shape

* Trying to guess if the user used a grayscale image when 3-channels expected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant