burn
burn copied to clipboard
ONNX_TO_BURN: Flatten: input tensor must have at least 2 dimensions (got 0)
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
Desktop (please complete the following information):
- OS: window11 WSL2
I will look into this soon. I have been busy with PyTorch import implementation.
I encountered the same issue, and it boils down to the fact that your Split layer, or in my case LeakyReLu is not supported: https://github.com/tracel-ai/burn/blob/main/burn-import/SUPPORTED-ONNX-OPS.md