sonos / tract

Tiny, no-nonsense, self-contained, Tensorflow and ONNX inference
Other
2.18k stars 210 forks source link

Resize operator output #743

Open cchudant opened 2 years ago

cchudant commented 2 years ago

Hello! I have some trouble with the ONNX Resize operator.

Short list:

I am currently trying to solve all (or at least, most) of these issues in a PR, I think this operator needs a bit of a refactor. Before that though, Are you ok with me working on that? Also, should this operator be moved to onnx-opl too, for nnef support?

kali commented 2 years ago

Yeah, Resize is typically an operator for which we ourselves have very little interest, so we welcome contribution on it.

I am aware of the limitations. I took an axis-per-axis approach that simplifies code a bit but requires two passes. I only looked at the growing case, not the shrinking case. And I only implemented a handful of the various possible combination.

I have not looked at all at the roi stuff... no big surprise.

Migrating it to -opl would be super nice too. I did not bother doing it because it was so uncooked.

If you plan some heavy refactoring, please give me an opportunity to discuss what you intend to do before throwing yourself at it.

cchudant commented 2 years ago

Cool! By refactor I did not mean heavy refactoring, just changing how inference_rules, output_facts are done, moving stuff to opl, and yes, probably redo the evaluation part.

I haven't really thought about how to do Resize without looping on every axes like this yet, but it shouldn't be too hard.

mfpekala commented 1 year ago

Hello! I've been running into some issues with Resize when trying to run the PaddleOCR model in tract after converting it to onnx. The onnx model works fine in python, but is panicking over an unknown symbol in the resize operator in tract. Were there any further developments on this? I'm considering setting up a minimal repo to reproduce and opening an issue, but want to make sure I'm not missing anything from earlier improvements which may fix my problem.

kali commented 1 year ago

Hello, thanks for your interest in tract.

No, there has not been any recent development on the Resize front. In order to document the issue, a minimal repo is good, but alternatively, you can use tract command line (see https://github.com/sonos/tract/blob/main/doc/cli-recipe.md#running-a-test-case).