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

Resize operator #18

Open
lingxutian opened this issue Jun 1, 2022 · 2 comments
Open

Resize operator #18

lingxutian opened this issue Jun 1, 2022 · 2 comments

Comments

@lingxutian
Copy link

[Fatal] (resolve) Unimplemented: Resize 'sizes' input is not a compile-time constant
onnx2c: /home/zentech/onnx2c/src/nodes/resize.h:82: virtual void toC::Resize::resolve(): Assertion `false' failed.
How should I modify it?

@kraiskil
Copy link
Owner

kraiskil commented Jun 2, 2022

Hi lingxutian,
this error means that your graph has a data dimension that is defined at run time (i.e. the input data defines a tensor size). This is valid ONNX, but not supported by onnx2c, since it mean dynamic memory handling - a many times problematic thing on microcontrollers.

If your ONNX graph design requires dynamic inputs sizes, then there is currently not much that can be done. Having onnx2c support that would require deep changes in its implementation.
One option is to modify your graph to not need dynamic input. E.g. if it is with images, scale the image to a fixed size before passing it to the graph for processing.

But these run time defined sizes can also happen by accident, since higher level frameworks don't really see dynamic sizes as problematic. I've noticed sometimes running the onnx file through e.g. onnxsim swaps out a dynamic tensor size for a fixed one.

Hope this helps :)

@PasaOpasen
Copy link

@kraiskil do u have some extended onnx translator which supports dynamic features?

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

3 participants