ALT Linux Bugzilla
– Attachment 21023 Details for
Bug 58481
Ошибка сегментирования при загрузке модели через onnxruntime
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
test code
test_code.txt (text/plain), 1.31 KB, created by
Савелий Солдатов
on 2026-04-02 13:58:59 MSK
(
hide
)
Description:
test code
Filename:
MIME Type:
Creator:
Савелий Солдатов
Created:
2026-04-02 13:58:59 MSK
Size:
1.31 KB
patch
obsolete
>#include <iostream> >#include "onnxruntime_cxx_api.h" > >int main() { > try { > Ort::Env env(ORT_LOGGING_LEVEL_WARNING, "test"); > Ort::SessionOptions opts; > opts.SetIntraOpNumThreads(1); > > std::cout << "Attempting to load model..." << std::endl; > Ort::Session session(env, "mnist-8.onnx", opts); > std::cout << "Model loaded successfully." << std::endl; > > Ort::AllocatorWithDefaultOptions alloc; > auto input_name = session.GetInputNameAllocated(0, alloc); > auto output_name = session.GetOutputNameAllocated(0, alloc); > std::cout << "Input name: " << input_name.get() << std::endl; > std::cout << "Output name: " << output_name.get() << std::endl; > > auto type_info = session.GetInputTypeInfo(0); > auto tensor_info = type_info.GetTensorTypeAndShapeInfo(); > auto shape = tensor_info.GetShape(); > std::cout << "Input shape: "; > for (auto d : shape) std::cout << d << " "; > std::cout << std::endl; > > std::cout << "Test passed (no inference)." << std::endl; > return 0; > } catch (const Ort::Exception& e) { > std::cerr << "ORT Error: " << e.what() << std::endl; > return 1; > } catch (const std::exception& e) { > std::cerr << "Std exception: " << e.what() << std::endl; > return 2; > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 58481
:
21022
| 21023