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

ONNX MaxPool auto_pad missing options #2497

Open
vesuvisian opened this issue Sep 24, 2024 · 0 comments
Open

ONNX MaxPool auto_pad missing options #2497

vesuvisian opened this issue Sep 24, 2024 · 0 comments

Comments

@vesuvisian
Copy link

The auto_pad attribute in candle-onnx currently only supports the default NOTSET option. It needs to be updated to include SAME_UPPER, at least, in order to run the Tiny YOLOv3 model that is available from the ONNX Model Zoo.

Here's a script that produces the Error: Msg("unsupported auto_pad SAME_UPPER") error:

use std::collections::HashMap;
use candle_core::{Device, Tensor};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let device = Device::Cpu;
    let model = candle_onnx::read_file("~/Downloads/tiny-yolov3-11.onnx")?;
    let mut input = HashMap::new();
    input.insert("input_1".to_string(), Tensor::rand(0f32, 1., (1, 3, 416, 416), &device)?);
    input.insert("image_shape".to_string(), Tensor::new(&[[120f32,400.]], &device)?);
    let result = candle_onnx::eval::simple_eval(&model, input)?;
    println!("{:?}", result);
    Ok(())
}
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

1 participant