Skip to content

ONNX burn-import: Can't transform Shape(4) to tensor #2930

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

Open
ungerpeter opened this issue Mar 20, 2025 · 4 comments
Open

ONNX burn-import: Can't transform Shape(4) to tensor #2930

ungerpeter opened this issue Mar 20, 2025 · 4 comments
Labels
bug Something isn't working onnx

Comments

@ungerpeter
Copy link

ungerpeter commented Mar 20, 2025

I tried to transform an onnx model to burn code using burn-import crate, but the build script fails with the following error:

ERROR burn_import::logger: PANIC => panicked at /Users/axpun/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/burn-import-0.16.0/src/onnx/to_burn.rs:1334:18: Can't transform Shape(4) to tensor.

This is the onnx model I tried to import:
https://huggingface.co/Soykaf/RTMW3D-x/tree/main/onnx

According to the supported onnx operations table, shape should be supported:
https://github.com/tracel-ai/burn/blob/main/crates/burn-import/SUPPORTED-ONNX-OPS.md

To Reproduce

  1. Download onnx model from HF via link above
  2. Follow the burn guide for onnx model import (https://burn.dev/burn-book/import/onnx-model.html)
  3. run cargo build
@Knight-Ops
Copy link
Contributor

Good news : I just put in a PR to fix this issue specifically. Shape should not successfully be processed.

Bad news : The model you are referencing has a few unsupported Onnx Ops : Unsupported ops: [Abs, DepthToSpace, Abs, Abs, Split, Split]

@ungerpeter
Copy link
Author

Good news : I just put in a PR to fix this issue specifically. Shape should not successfully be processed.

Bad news : The model you are referencing has a few unsupported Onnx Ops : Unsupported ops: [Abs, DepthToSpace, Abs, Abs, Split, Split]

Thank you!

@AdrianEddy
Copy link

I have the same issue with a different model, and looks like that PR was closed. I think this issue should be opened again?
I'm trying this model: https://huggingface.co/TheEeeeLin/HivisionIDPhotos_matting/blob/main/retinaface-resnet50.onnx

@antimora
Copy link
Collaborator

Reopening it per AdrianEddy request.

@antimora antimora reopened this Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working onnx
Projects
None yet
Development

No branches or pull requests

5 participants