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

Previous yolo-v3.ot outdated / yolo/main.rs needs update #543

Closed
ralfbiedert opened this issue Oct 26, 2022 · 3 comments
Closed

Previous yolo-v3.ot outdated / yolo/main.rs needs update #543

ralfbiedert opened this issue Oct 26, 2022 · 3 comments

Comments

@ralfbiedert
Copy link

First of all thank you so much for tch-rs! I've been working with it for a while now and it has been an absolute joy to use!

I was now trying to run the yolo example and downloaded the weights mentioned in yolo/main.rs, which was also recommended in #337, #334 or #293.

However, when trying to run cargo run --example yolo yolo-v3.ot cat.jpg with said file I get

Error: Internal torch error: Legacy model format is not supported on mobile.
Exception raised from deserialize at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\jit\serialization\import.cpp:273 (most recent call first):
00007FFBE7F7DA2200007FFBE7F7D9C0 c10.dll!c10::Error::Error [<unknown file> @ <unknown line number>]
00007FFBE7F7D43E00007FFBE7F7D3F0 c10.dll!c10::detail::torchCheckFail [<unknown file> @ <unknown line number>]
00007FFB5593344200007FFB55930CB0 torch_cpu.dll!torch::jit::CallStackDebugInfoUnpickler::unpickle [<unknown file> @ <unknown line number>]
00007FFB5593557D00007FFB55935400 torch_cpu.dll!torch::jit::load [<unknown file> @ <unknown line number>]
00007FFB559351ED00007FFB559350E0 torch_cpu.dll!torch::jit::load [<unknown file> @ <unknown line number>]
00007FFB5593502A00007FFB55934F80 torch_cpu.dll!torch::jit::load [<unknown file> @ <unknown line number>]
00007FF7CAE1052900007FF7CAE10490 yolo.exe!at_load_callback_with_device [C:\Users\rb\Development\Source\_thirdparty\tch-rs\torch-sys\libtch\torch_api.cpp @ 418]
00007FF7CAD848F900007FF7CAD847C0 yolo.exe!tch::wrappers::tensor::Tensor::load_multi_with_device<ref$<ref$<alloc::string::String> > > [C:\Users\rb\Development\Source\_thirdparty\tch-rs\src\wrappers\tensor.rs @ 643]
00007FF7CAD69E3E00007FF7CAD69DF0 yolo.exe!tch::nn::var_store::VarStore::load<ref$<alloc::string::String> > [C:\Users\rb\Development\Source\_thirdparty\tch-rs\src\nn\var_store.rs @ 177]
00007FF7CAD6C46F00007FF7CAD6C170 yolo.exe!yolo::main [C:\Users\rb\Development\Source\_thirdparty\tch-rs\examples\yolo\main.rs @ 119]
00007FF7CAD7F07B00007FF7CAD7F070 yolo.exe!core::ops::function::FnOnce::call_once<enum2$<core::result::Result<tuple$<>,anyhow::Error> > (*)(),tuple$<> > [/rustc/95a992a68694d8bf3959bd2c0ac27ce9e9208b59\library\core\src\ops\function.rs @ 248]
00007FF7CAD6288E00007FF7CAD62880 yolo.exe!std::sys_common::backtrace::__rust_begin_short_backtrace<enum2$<core::result::Result<tuple$<>,anyhow::Error> > (*)(),enum2$<core::result::Result<tuple$<>,anyhow::Error> > > [/rustc/95a992a68694d8bf3959bd2c0ac27ce9e9208b59\library\std\src\sys_common\backtrace.rs @ 122]
00007FF7CAD8729100007FF7CAD87280 yolo.exe!std::rt::lang_start::closure$0<enum2$<core::result::Result<tuple$<>,anyhow::Error> > > [/rustc/95a992a68694d8bf3959bd2c0ac27ce9e9208b59\library\std\src\rt.rs @ 166]
00007FF7CADEBC7E00007FF7CADEBBC0 yolo.exe!std::rt::lang_start_internal [/rustc/95a992a68694d8bf3959bd2c0ac27ce9e9208b59/library\std\src\rt.rs @ 148]
00007FF7CAD8726A00007FF7CAD87230 yolo.exe!std::rt::lang_start<enum2$<core::result::Result<tuple$<>,anyhow::Error> > > [/rustc/95a992a68694d8bf3959bd2c0ac27ce9e9208b59\library\std\src\rt.rs @ 165]
00007FF7CAD6D29C00007FF7CAD6D280 yolo.exe!main [<unknown file> @ <unknown line number>]
00007FF7CAF588B400007FF7CAF587A8 yolo.exe!__scrt_common_main_seh [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 288]
00007FFC3D7054E000007FFC3D7054D0 KERNEL32.DLL!BaseThreadInitThunk [<unknown file> @ <unknown line number>]
00007FFC3F24485B00007FFC3F244830 ntdll.dll!RtlUserThreadStart [<unknown file> @ <unknown line number>]

I'll try to follow this here next, but I think the example needs an updated description in any case.

@LaurentMazare
Copy link
Owner

Thanks for reporting this. I've updated the weights from the link you mentioned so this should hopefully be fixed now. I've also added a bit more details in the yolo example on how the weights could be generated.

@ralfbiedert
Copy link
Author

Thanks, I can try tomorrow and will report back!

When diving into this I've also encountered a few questions for which I've opened a new ticket here #549.

@ralfbiedert
Copy link
Author

Worked, thanks a lot!

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

2 participants