Skip to content

"model_path must not be empty" for valid file #37

@guyluz11

Description

@guyluz11

I have used the example project and added model.onnx from https://huggingface.co/pszemraj/bigbird-pegasus-large-K-booksum under assets/models.

Then I have replaced this line
const assetFileName = 'assets/models/silero_vad.onnx';

with
const assetFileName = 'assets/models/model.onnx';

And getting an error about loading the model:

2025-01-09 09:56:25.374262135 [E:onnxruntime:, inference_session.cc:1644 operator()] Exception during initialization: /onnxruntime_src/onnxruntime/core/optimizer/initializer.cc:30 onnxruntime::Initializer::Initializer(const onnx::TensorProto&, const onnxruntime::Path&) !model_path.IsEmpty() was false. model_path must not be empty. Ensure that a path is provided when the model is created or loaded.

[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: code=6, message=Exception during initialization: /onnxruntime_src/onnxruntime/core/optimizer/initializer.cc:30 onnxruntime::Initializer::Initializer(const onnx::TensorProto&, const onnxruntime::Path&) !model_path.IsEmpty() was false. model_path must not be empty. Ensure that a path is provided when the model is created or loaded.

#0      OrtStatus.checkOrtStatus (package:onnxruntime/src/ort_status.dart:29:5)
#1      new OrtSession.fromBuffer (package:onnxruntime/src/ort_session.dart:62:15)
#2      VadIterator.initModel (package:onnxruntime_example/vad_iterator.dart:72:27)
<asynchronous suspension>

Running on Linux, the original model works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions