huggingface / huggingface/candle

ONNX MaxPool auto_pad missing options

Open
#2,497 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
21k
Forks
1.8k
Avg merge
16h 42m
Merged PRs (30d)
25

Description

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](https://github.com/onnx/models/tree/main/validated/vision/object_detection_segmentation/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> {
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(())
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the supplied Rust reproduction with the Tiny YOLOv3 ONNX model and tracing MaxPool handling through candle_onnx::eval::simple_eval. Done means the auto_pad SAME_UPPER option is accepted and the model no longer fails with the unsupported-option error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.