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

Help / Load model from silero_vad.onnx failed:Protobuf parsing failed. #453

Closed
NathanJHLee opened this issue May 28, 2024 · 3 comments
Closed
Assignees
Labels
help wanted Extra attention is needed

Comments

@NathanJHLee
Copy link

NathanJHLee commented May 28, 2024

❓ Questions and Help

We have a wiki available for our users. Please make sure you have checked it out first.

Hi, My name is Nathan and I am follwing your instruction to build testfile for "Stream example in C++"
I got some error.

My env is Centos7 and I installed gcc 12.2.0 myself.
I faced few error cause mismatch between window and linux. So finally I compiled test binary and run.
But error occurred as below.

test wav file is my own thing.

num_channel_ :1
sample_rate_ :16000
bits_per_sample_:16
num_samples :403840
num_data_size :807680
terminate called after throwing an instance of 'Ort::Exception'
what(): Load model from silero_vad.onnx failed:Protobuf parsing failed.

I downloaded onnx model from here 'https://github.com/ricky0123/vad/blob/master/silero_vad.onnx'

please help me to fix it.
Thank you.

p.s

I tested model loading about 'silero_vad.onnx '
souce as below.
I got same error
"Failed to load the model: Load model from silero_vad.onnx failed:Protobuf parsing failed."

#include
#include "onnxruntime_cxx_api.h"
#include "cpu_provider_factory.h"

int main() {
// Initialize the ONNX Runtime environment
Ort::Env env(ORT_LOGGING_LEVEL_WARNING, "test");

// Initialize session options
Ort::SessionOptions session_options;
session_options.SetIntraOpNumThreads(1);

// Set the optimization level to basic
session_options.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_BASIC);

// Load the ONNX model
const char* model_path = "silero_vad.onnx";
try {
    Ort::Session session(env, model_path, session_options);
    std::cout << "Model loaded successfully." << std::endl;

    // Further processing with the model...

} catch (const Ort::Exception& e) {
    std::cerr << "Failed to load the model: " << e.what() << std::endl;
}

return 0;

}

@NathanJHLee NathanJHLee added the help wanted Extra attention is needed label May 28, 2024
@gongouveia
Copy link

@NathanJHLee I get same error in Java implementation example. ONNX models is not laodable :/

@snakers4
Copy link
Owner

The new VAD version was released just now - #2 (comment).
If the issue persists with the new version, can you please open a new issue referring to this one.
Many thanks!

@NathanJHLee
Copy link
Author

NathanJHLee commented Jul 10, 2024

Hi snakers4.
I tried your new VAD version to run.
But it seem same error as bleow.

terminate called after throwing an instance of 'Ort::Exception'
what(): Load model from silero_vad.onnx failed:Protobuf parsing failed.
Aborted (core dumped)

My env is

docker gcc:12.2.0-bullseye

and I modified some line
//std::wstring path = L"silero_vad.onnx";
std::string path = "silero_vad.onnx";

std::wstring -> std::string

$du -hs silero_vad.onnx
260K silero_vad.onnx

please check my problem.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants