-
Notifications
You must be signed in to change notification settings - Fork 624
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Silero VAD C++ (without libtorch) Fails to Compile with ONNX Runtime 1.21.0
I attempted to compile and run the Silero VAD C++ implementation (without libtorch) using the provided code, but I encountered compilation errors related to the Ort::Session
constructor. The errors suggest a mismatch between the expected arguments for the Ort::Session
constructor and the arguments being passed in the code. Below are the errors I encountered:
/mnt/windowsD/Projects/libspeech/examples/silero/silero-vad-onnx.cpp:136:49: required from here
/usr/include/c++/11/ext/new_allocator.h:162:11: error: no matching function for call to ‘Ort::Session::Session(Ort::Env&, const wchar_t*, Ort::SessionOptions&)’
162 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
/mnt/windowsD/Projects/libspeech/src/third_party/onnxruntime/include/onnxruntime_cxx_inline.h:1128:58: note: no known conversion for argument 2 from ‘const wchar_t*’ to ‘const char*’
1128 | inline Session::Session(const Env& env, const ORTCHAR_T* model_path, const SessionOptions& options) {
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~
Key Observations:
- The
Ort::Session
constructor expects aconst char*
for the model path, but the code is passing aconst wchar_t*
. - The error occurs when trying to initialize the
Ort::Session
object in theinit_onnx_model
function:session = std::make_shared<Ort::Session>(env, model_path.c_str(), session_options);
Environment Details:
- ONNX Runtime Version: 1.21.0 (downloaded and built locally)
- Compiler: GCC 11
- Operating System: Linux
- Code Source: Silero VAD C++ implementation without libtorch.
Questions:
- What version of ONNX Runtime was this code tested with?
- I used ONNX Runtime 1.21.0, but it seems there might be a compatibility issue.
- Is there a specific version of ONNX Runtime that this code is designed to work with?
- If so, could you please specify the exact version?
- Should the code be updated to support newer versions of ONNX Runtime?
- It appears that the API for
Ort::Session
has changed, and the current implementation may need adjustments to align with the latest ONNX Runtime APIs.
- It appears that the API for
Thank you for your assistance! I look forward to your feedback on resolving these issues.
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed