Closed garyhai closed 1 year ago
Please give a shot at the current main branch, I have switch a default to be more lenient about ill-sized onnx network as this error was a pain. Tell me if it works better.
Thanks. Output with current main branch "2ea76c09678f092d00713ebbe6fdb046c0a9ad0f"
thread 'main' panicked at 'failed to create vad session: Translating node #74 "If_25" If ToTypedTranslator
Caused by:
0: Translating node #29 "If_69" If ToTypedTranslator
1: in output_facts invocation for If
2: Condition failed: `self.then_body.output_fact(i)?.without_value() == self.else_body.output_fact(i)?.without_value()` (1,1,1728,F32 vs 1,1,1,1728,F32)
Stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /Users/gary/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.69/src/backtrace/libunwind.rs:93:5
backtrace::backtrace::trace_unsynchronized
at /Users/gary/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.69/src/backtrace/mod.rs:66:5
1: backtrace::backtrace::trace
at /Users/gary/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.69/src/backtrace/mod.rs:53:14
2: anyhow::backtrace::capture::Backtrace::create
at /Users/gary/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/backtrace.rs:216:13
3: anyhow::backtrace::capture::Backtrace::capture
at /Users/gary/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/backtrace.rs:204:17
4: anyhow::error::<impl anyhow::Error>::msg
at /Users/gary/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/error.rs:83:36
5: anyhow::ensure::render
at /Users/gary/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/ensure.rs:97:20
6: <(A,B) as anyhow::ensure::BothDebug>::__dispatch_ensure
at /Users/gary/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.75/src/ensure.rs:20:9
7: <tract_core::ops::logic::ite::IfThenElse as tract_core::ops::TypedOp>::output_facts
at /Users/gary/local/tract/core/src/ops/logic/ite.rs:27:13
8: tract_core::model::typed::<impl tract_core::model::graph::SpecialOps<tract_core::model::fact::TypedFact,alloc::boxed::Box<dyn tract_core::ops::TypedOp>> for tract_core::model::graph::Graph<tract_core::model::fact::TypedFact,alloc::boxed::Box<dyn tract_core::ops::TypedOp>>>::wire_node
at /Users/gary/local/tract/core/src/model/typed.rs:73:32
9: <tract_onnx::ops::logic::If as tract_hir::infer::ops::InferenceOp>::to_typed
at /Users/gary/local/tract/onnx/src/ops/logic.rs:179:9
10: <<tract_core::model::graph::Graph<tract_hir::infer::fact::InferenceFact,alloc::boxed::Box<dyn tract_hir::infer::ops::InferenceOp>> as tract_hir::infer::model::InferenceModelExt>::into_typed::ToTypedTranslator as tract_core::model::translator::Translate<tract_hir::infer::fact::InferenceFact,alloc::boxed::Box<dyn tract_hir::infer::ops::InferenceOp>,tract_core::model::fact::TypedFact,alloc::boxed::Box<dyn tract_core::ops::TypedOp>>>::translate_node
at /Users/gary/local/tract/hir/src/infer/model.rs:121:35
11: tract_core::model::translator::Translate::translate_model_with_mappings
at /Users/gary/local/tract/core/src/model/translator.rs:34:27
12: tract_core::model::translator::Translate::translate_model
at /Users/gary/local/tract/core/src/model/translator.rs:23:12
13: <tract_core::model::graph::Graph<tract_hir::infer::fact::InferenceFact,alloc::boxed::Box<dyn tract_hir::infer::ops::InferenceOp>> as tract_hir::infer::model::InferenceModelExt>::into_typed
at /Users/gary/local/tract/hir/src/infer/model.rs:139:9
14: <tract_onnx::ops::logic::If as tract_hir::infer::ops::InferenceOp>::to_typed
at /Users/gary/local/tract/onnx/src/ops/logic.rs:170:25
15: <<tract_core::model::graph::Graph<tract_hir::infer::fact::InferenceFact,alloc::boxed::Box<dyn tract_hir::infer::ops::InferenceOp>> as tract_hir::infer::model::InferenceModelExt>::into_typed::ToTypedTranslator as tract_core::model::translator::Translate<tract_hir::infer::fact::InferenceFact,alloc::boxed::Box<dyn tract_hir::infer::ops::InferenceOp>,tract_core::model::fact::TypedFact,alloc::boxed::Box<dyn tract_core::ops::TypedOp>>>::translate_node
at /Users/gary/local/tract/hir/src/infer/model.rs:121:35
16: tract_core::model::translator::Translate::translate_model_with_mappings
at /Users/gary/local/tract/core/src/model/translator.rs:34:27
17: tract_core::model::translator::Translate::translate_model
at /Users/gary/local/tract/core/src/model/translator.rs:23:12
18: <tract_core::model::graph::Graph<tract_hir::infer::fact::InferenceFact,alloc::boxed::Box<dyn tract_hir::infer::ops::InferenceOp>> as tract_hir::infer::model::InferenceModelExt>::into_typed
at /Users/gary/local/tract/hir/src/infer/model.rs:139:9
19: <tract_core::model::graph::Graph<tract_hir::infer::fact::InferenceFact,alloc::boxed::Box<dyn tract_hir::infer::ops::InferenceOp>> as tract_hir::infer::model::InferenceModelExt>::into_optimized
at /Users/gary/local/tract/hir/src/infer/model.rs:148:9
20: ican_audio::vad::load_model
at ./audio/src/vad.rs:166:34
21: ican_audio::vad::Vad::new
at ./audio/src/vad.rs:144:7
22: ican_audio::vad::VadSession::create
at ./audio/src/vad.rs:221:24
23: segment::main
at ./examples/segment.rs:26:13
24: core::ops::function::FnOnce::call_once
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/ops/function.rs:250:5
25: std::sys_common::backtrace::__rust_begin_short_backtrace
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:135:18
26: std::rt::lang_start::{{closure}}
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/rt.rs:166:18
27: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/ops/function.rs:284:13
std::panicking::try::do_call
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:500:40
std::panicking::try
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:464:19
std::panic::catch_unwind
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panic.rs:142:14
std::rt::lang_start_internal::{{closure}}
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/rt.rs:148:48
std::panicking::try::do_call
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:500:40
std::panicking::try
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:464:19
std::panic::catch_unwind
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panic.rs:142:14
std::rt::lang_start_internal
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/rt.rs:148:20
28: std::rt::lang_start
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/rt.rs:165:17
29: _main
30: <unknown>', examples/segment.rs:26:41
stack backtrace:
0: rust_begin_unwind
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:593:5
1: core::panicking::panic_fmt
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/panicking.rs:67:14
2: core::result::unwrap_failed
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/result.rs:1651:5
3: core::result::Result<T,E>::expect
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/result.rs:1033:23
4: segment::main
at ./examples/segment.rs:26:13
5: core::ops::function::FnOnce::call_once
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
make: *** [segment] Error 101
The link of cpp version to load the onnx model:
https://github.com/snakers4/silero-vad/blob/master/examples/cpp/silero-vad-onnx.cpp
I think I have seen this model before, and it had some structural things that were making it difficult for tract. Can you link me the onxx file so I can have a look ?
See #1029 actually.
Sure. Here is the file link: https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx
Thanks, #1029 described it more accurately than I did.
ok, so I guess we're looking at a duplicate of #1029 and #1062, right ?
Yes. I think so.
I'm going to close this one then, as it does not bring much light to the issue.
Failed to load silero_vad.onnx with a single dimension input of sampling rate.