Rajan chawla
Rajan chawla

Reputation: 71

Issue with model registry Azure - onnxruntime.capi.onnxruntime_pybind11_state.NoSuchFile: [ONNXRuntimeError] : 3 : NO_SUCHFILE

I am trying to load an onnx model from azure registry but it is unable to locate the mode. The error i am getting is as follows -

ERROR

2021-12-01 11:06:44,182 | root | ERROR | Encountered Exception Traceback (most recent call last): File "/opt/miniconda/envs/amlenv/lib/python3.7/site-packages/azureml_inference_server_http/server/aml_blueprint.py", line 201, in register main.init() File "/var/azureml-app/211201115339-240776055/score.py", line 11, in init session = onnxruntime.InferenceSession(model) File "/opt/miniconda/envs/amlenv/lib/python3.7/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 206, in init self._create_inference_session(providers, provider_options) File "/opt/miniconda/envs/amlenv/lib/python3.7/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 226, in _create_inference_session sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model) onnxruntime.capi.onnxruntime_pybind11_state.NoSuchFile: [ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from mnist.onnx failed:Load model mnist.onnx failed. File doesn't exist

My INIT FUNCTION is as follows in score.py

def init():
    global session
    model = "mnist.onnx"
    session = onnxruntime.InferenceSession(model)

Model in registry looks like that enter image description here

Upvotes: 0

Views: 1105

Answers (1)

Rajan chawla
Rajan chawla

Reputation: 71

I found the solution the path is as follows - "/var/azureml-app/azureml-models/mnist/1/mnist.onnx"

Upvotes: 0

Related Questions