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

yolov10 ReduceMax keepdims == 0 #2816

Open
sihaiwuhu opened this issue Feb 15, 2025 · 1 comment
Open

yolov10 ReduceMax keepdims == 0 #2816

sihaiwuhu opened this issue Feb 15, 2025 · 1 comment
Labels
bug Something isn't working enhancement Enhance existing features onnx

Comments

@sihaiwuhu
Copy link

Hi, there is a panic like this when building from yolov10.onnx model. How should I solve this error?

ERROR burn_import::logger: PANIC => panicked at /home/ubuntu/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/burn-import-0.16.0/src/onnx/op_configuration.rs:1467:9:
ReduceMax: the reduce operation must preserve the reduced dimension

--- stderr
thread 'main' panicked at /home/ubuntu/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/burn-import-0.16.0/src/onnx/op_configuration.rs:1467:9:
ReduceMax: the reduce operation must preserve the reduced dimension
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
ubuntu@PC-PW09NVP9:/mnt/d/workspace/rust_ws/burn_demo1$

@laggui
Copy link
Member

laggui commented Feb 17, 2025

That's because keepdims is set to false, and that's not currently supported when converting the model to Burn code.

if !axes.is_empty() && keepdims == 0 {
// Not supported in Burn
panic!("ReduceMax: the reduce operation must preserve the reduced dimension")
}

In burn, tensor.max_dim(dim) returns a tensor of the same rank (with a dim of size 1 where it was reduced). The support could be expanded in the codegen to chain a max operation with .squeeze(dim) when keepdims is false.

@laggui laggui added bug Something isn't working enhancement Enhance existing features onnx labels Feb 17, 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 enhancement Enhance existing features onnx
Projects
None yet
Development

No branches or pull requests

2 participants