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

Trouble importing FaceONNX detector model: Only tensor indices is valid #1915

Open
SimonBrandner opened this issue Jun 21, 2024 · 2 comments

Comments

@SimonBrandner
Copy link

Describe the bug

Error during importing the detector model:

ERROR burn_import::logger: PANIC => panicked at /home/simon/Data1/GIT/Rust/burn/crates/burn-import/src/onnx/dim_inference.rs:820:14:
Only tensor indices is valid    

To Reproduce

  1. Download detector model from https://drive.google.com/file/d/1tB7Y5l5Jf2270IisgSZ3rbCQs0-pkNIQ/view?usp=drive_link
  2. Move the file to src/model/detector.onnx
  3. Add this to build.rs
	ModelGen::new()
		.input("src/model/detector.onnx")
		.out_dir("model/")
		.run_from_script();
  1. Build and see error

What I've figured out so far

@laggui
Copy link
Member

laggui commented Jun 21, 2024

As you correctly pointed out the issue is with the gather node.

We check for the inputs to make sure they are in accordance with the spec, but when checking for the indices we expect a tensor but your model uses a scalar (rank 0 tensor) - which is still valid according to the spec but currently will run into issues with the rest of the codegen for Burn (see issue #1689).

@laggui
Copy link
Member

laggui commented Jun 21, 2024

Also I just realized your model was generated with an older opset (v9) and we might not support all of the ops there. Right now the ops we have should support the latest ops at opset 13. Some also have support for older opset but not all (e.g., Slice which I see in your model is opset v1 and we don't parse the attributes).

The ONNX spec is large and our bandwidth for that is a bit limited.

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

2 participants