axon_onnx icon indicating copy to clipboard operation
axon_onnx copied to clipboard

Unsupported op_type "Resize"

Open jnnks opened this issue 2 years ago • 4 comments

The model Tiny YOLOv3 raises an ArgumentError when trying to import it:

** (ArgumentError) unsupported "Resize"
    (axon_onnx 0.1.0) lib/axon_onnx/deserialize.ex:1595: AxonOnnx.Deserialize.recur_nodes/2
    (elixir 1.13.2) lib/enum.ex:2396: Enum."-reduce/3-lists^foldl/2-0-"/3
    (axon_onnx 0.1.0) lib/axon_onnx/deserialize.ex:44: AxonOnnx.Deserialize.graph_to_axon/2
    (axon_onnx 0.1.0) lib/axon_onnx/deserialize.ex:27: AxonOnnx.Deserialize.to_axon/2

Seems like Axon has functionality for that, but it is not "plugged in" yet: https://hexdocs.pm/axon/Axon.html#resize/3. Maybe I can do that?

(Follow up to https://github.com/elixir-nx/axon_onnx/issues/33)

jnnks avatar Jun 26 '22 19:06 jnnks

@jnnks I would welcome a PR for resize! Let me know if you need any help. The Axon resize should have all of the pieces you need

seanmor5 avatar Jun 26 '22 19:06 seanmor5

This issue also arises with yolov8n (probably all the yolo models?). I can see a lot of work on this by @jnnks from the middle of last year. Is there anything I can do to help get this done and merged? I'd really like to build more axon-based models in my image library but this is a blocker for me.

kipcole9 avatar Mar 20 '23 00:03 kipcole9

Hi @kipcole9, my work on this issue has been rather superficial to be quite honest. I suppose the code commited in the PR is a start, but does not cover all of the functionality described in the ONNX spec. The sample data provided by ONNX cannot be used for the tests directly and has to be changed. The Protobuf files need to be decoded, changed and reencoded for the model and all test vectors.# Even then the calculated result seems to be off.

I'll see if I can use some time to work on this again this week.

jnnks avatar Mar 21 '23 02:03 jnnks

There is no doubt I under appreciate the amount of work and skill required - well beyond my abilities. But I think the whole community (definitely me!) would be very happy if we can use the yolo family of models with axon via axon_onnx.

Thanks for considering picking this up again. And if there's any non-skilled grunt work that would help, let me know and I'll dive right in.

kipcole9 avatar Mar 21 '23 02:03 kipcole9