Skip to content

ONNX error input tensor must have at least 2 dimensions #1130

@wanglong001

Description

@wanglong001

Describe the bug
onnx model of yolov5 to burn error:

ERROR burn_import::logger: PANIC => panicked at /home/wzl/.cargo/git/checkouts/burn-178c6829f420dae1/f43b686/burn-import/src/onnx/op_configuration.rs:229:9:
Flatten: input tensor must have at least 2 dimensions (got 0)    
thread 'main' panicked at /home/wzl/.cargo/git/checkouts/burn-178c6829f420dae1/f43b686/burn-import/src/onnx/op_configuration.rs:229:9:
Flatten: input tensor must have at least 2 dimensions (got 0)

To Reproduce

    std::env::set_var("OUT_DIR", ".");
    let onnx_path_str = "/tmp/slient.onnx";
    // let onnx_path = std::path::PathBuf::from(onnx_path_str);
    burn_import::onnx::ModelGen::new()
        .input("/tmp/best.onnx")
        .out_dir("model/")
        .run_from_script();

Expected behavior
no panic

Screenshots
image

Desktop (please complete the following information):

  • OS: window11 WSL2

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingonnx

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions