mortont / axon_onnx

Easily convert models between ONNX and Axon
Apache License 2.0
91 stars 20 forks source link

Unsupported op_type "Resize" #34

Open jnnks opened 2 years ago

jnnks commented 2 years ago

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)

seanmor5 commented 2 years ago

@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

kipcole9 commented 1 year ago

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.

jnnks commented 1 year ago

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.

kipcole9 commented 1 year ago

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.