huggingface / huggingface/candle

unsupported op_type STFT for op

Open
#2,254 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
21.1k
Forks
1.8k
Avg merge
16h 42m
Merged PRs (30d)
25

Description

I have an onnx model converted from pytorch, but encountered an error using candle inference.
I have confirmed that this onnx model can work properly on Python. I also checked that the shape and data type of the input tensor are the same.

called `Result::unwrap()` on an `Err` value: WithBacktrace { inner: Msg("unsupported op_type STFT for op NodeProto { inp
ut: [\"2829\", \"/Constant_12_output_0\", \"/Constant_14_output_0\", \"/Constant_13_output_0\"], output: [\"/STFT_output
_0\"], name: \"/STFT\", op_type: \"STFT\", domain: \"\", attribute: [AttributeProto { name: \"onesided\", ref_attr_name:
 \"\", doc_string: \"\", r#type: Int, f: 0.0, i: 1, s: [], t: None, g: None, sparse_tensor: None, tp: None, floats: [],
ints: [], strings: [], tensors: [], graphs: [], sparse_tensors: [], type_protos: [] }], doc_string: \"\" }"), backtrace:
 Backtrace [{ fn: "std::backtrace_rs::backtrace::dbghelp64::trace", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6
d6/library\std\src\..\..\backtrace\src\backtrace\dbghelp64.rs", line: 99 }, { fn: "std::backtrace_rs::backtrace::trace_u
nsynchronized", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\..\..\backtrace\src\backtrace\mod
.rs", line: 66 }, { fn: "std::backtrace::Backtrace::create", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/libr
ary\std\src\backtrace.rs", line: 331 }, { fn: "std::backtrace::Backtrace::capture", file: "/rustc/9b00956e56009bab2aa15d
7bff10916599e3d6d6/library\std\src\backtrace.rs", line: 296 }, { fn: "enum2$<candle_core::error::Error>::bt", file: "G:\
rust\candle\candle-core\src\error.rs", line: 231 }, { fn: "candle_onnx::eval::simple_eval_", file: "G:\rust\candle\candl
e-onnx\src\eval.rs", line: 1197 }, { fn: "candle_onnx::eval::simple_eval", file: "G:\rust\candle\candle-onnx\src\eval.rs
", line: 232 }, { fn: "inference_rust::main", file: ".\src\main.rs", line: 99 }, { fn: "core::ops::function::FnOnce::cal
l_once<void (*)(),tuple$<> >", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6\library\core\src\ops\function.rs",
 line: 250 }, { fn: "core::hint::black_box", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6\library\core\src\hin
t.rs", line: 337 }, { fn: "std::sys_common::backtrace::__rust_begin_short_backtrace<void (*)(),tuple$<> >", file: "/rust
c/9b00956e56009bab2aa15d7bff10916599e3d6d6\library\std\src\sys_common\backtrace.rs", line: 155 }, { fn: "std::rt::lang_s
tart::closure$0<tuple$<> >", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6\library\std\src\rt.rs", line: 166 },
 { fn: "std::rt::lang_start_internal", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\rt.rs", li
ne: 148 }, { fn: "std::rt::lang_start<tuple$<> >", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6\library\std\sr
c\rt.rs", line: 165 }, { fn: "main" }, { fn: "invoke_main", file: "D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\
exe_common.inl", line: 78 }, { fn: "__scrt_common_main_seh", file: "D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup
\exe_common.inl", line: 288 }, { fn: "BaseThreadInitThunk" }, { fn: "RtlUserThreadStart" }] }
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\panicking.rs:645
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\panicking.rs:72
   2: core::result::unwrap_failed
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\result.rs:1654
   3: enum2$<core::result::Result<std::collections::hash::map::HashMap<alloc::string::String,candle_core::tensor::Tensor
,std::hash::random::RandomState>,enum2$<candle_core::error::Error> > >::unwrap
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6\library\core\src\result.rs:1077
   4: inference_rust::main
             at .\src\main.rs:99
   5: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6\library\core\src\ops\function.rs:250
   6: core::hint::black_box
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6\library\core\src\hint.rs:337
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in candle-onnx/src/eval.rs at simple_eval_ around line 1197, where the unsupported STFT operation is reported, and inspect the evaluator's existing operator handling. Reproduce the failure with the reported ONNX model or an STFT case; done means the model no longer fails with the unsupported-op error and the behavior is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.