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

Unsupported op_type Pad for op #2196

Closed
mzdk100 opened this issue May 19, 2024 · 1 comment
Closed

Unsupported op_type Pad for op #2196

mzdk100 opened this issue May 19, 2024 · 1 comment

Comments

@mzdk100
Copy link

mzdk100 commented May 19, 2024

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.

thread 'main' panicked at src\main.rs:91:64:
called `Result::unwrap()` on an `Err` value: WithBacktrace { inner: Msg("unsupported op_type Pad for op NodeProto { inpu
t: [\"/Unsqueeze_output_0\", \"/Reshape_1_output_0\"], output: [\"/Pad_output_0\"], name: \"/Pad\", op_type: \"Pad\", do
main: \"\", attribute: [AttributeProto { name: \"mode\", ref_attr_name: \"\", doc_string: \"\", r#type: String, f: 0.0,
i: 0, s: [114, 101, 102, 108, 101, 99, 116], t: None, g: None, sparse_tensor: None, tp: None, floats: [], ints: [], stri
ngs: [], tensors: [], graphs: [], sparse_tensors: [], type_protos: [] }], doc_string: \"\" }"), backtrace: Backtrace [{
fn: "std::backtrace_rs::backtrace::dbghelp64::trace", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std
\src\..\..\backtrace\src\backtrace\dbghelp64.rs", line: 99 }, { fn: "std::backtrace_rs::backtrace::trace_unsynchronized"
, file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\..\..\backtrace\src\backtrace\mod.rs", line: 66
 }, { fn: "std::backtrace::Backtrace::create", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\ba
cktrace.rs", line: 331 }, { fn: "std::backtrace::Backtrace::capture", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3
d6d6/library\std\src\backtrace.rs", line: 296 }, { fn: "enum2$<candle_core::error::Error>::bt", file: "D:\rust\cargo\reg
istry\src\index.crates.io-6f17d22bba15001f\candle-core-0.5.0\src\error.rs", line: 231 }, { fn: "candle_onnx::eval::simpl
e_eval", file: "D:\rust\cargo\registry\src\index.crates.io-6f17d22bba15001f\candle-onnx-0.5.0\src\eval.rs", line: 1014 }
, { fn: "inference_rust::main", file: ".\src\main.rs", line: 91 }, { fn: "core::ops::function::FnOnce::call_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\hint.rs", line: 3
37 }, { fn: "std::sys_common::backtrace::__rust_begin_short_backtrace<void (*)(),tuple$<> >", file: "/rustc/9b00956e5600
9bab2aa15d7bff10916599e3d6d6\library\std\src\sys_common\backtrace.rs", line: 155 }, { fn: "std::rt::lang_start::closure$
0<tuple$<> >", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6\library\std\src\rt.rs", line: 166 }, { fn: "std::r
t::lang_start_internal", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\rt.rs", line: 148 }, { f
n: "std::rt::lang_start<tuple$<> >", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6\library\std\src\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.in
l", 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:91
   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.
error: process didn't exit successfully: `target\debug\inference_rust.exe` (exit code: 101)
kuzemchik pushed a commit to kuzemchik/candle that referenced this issue May 20, 2024
@mzdk100
Copy link
Author

mzdk100 commented Jun 7, 2024

commit b9fac7e has already resolved this issue.

@mzdk100 mzdk100 closed this as completed Jun 7, 2024
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