tract icon indicating copy to clipboard operation
tract copied to clipboard

A bug about Constant in Resize

Open oaifaye opened this issue 2 years ago • 1 comments

Hi developer, I may have found a bug in line 25 of onnx/src/ops/resize.rs. The code is as follows:

let mut options = crate::model::optional_inputs(node).skip(2);

In onnx, the first parameter of options is the input to the image, the second is scale, and the third is sizes. Here you construct Resize to get optional_scales_input and optional_sizes_input. You should only skip the first parameter of options, but skip both of them. This will fail to get the parameters as shown in the image below. 图片

So I think it should be changed to something like this:

let mut options = crate::model::optional_inputs(node).skip(1);

oaifaye avatar Oct 25 '23 11:10 oaifaye

Can you try to reproduce on tract's top of tree ? I have already refactored the Resize parsing to adapt to the various iteration of ONNX Resize spec...

kali avatar Oct 25 '23 12:10 kali