onnx / tutorials

Tutorials for creating and using ONNX models
Apache License 2.0
3.35k stars 627 forks source link

Error 500 "no model loaded" with Tutorial OnnxRuntimeServerSSDModel.ipynb #155

Open mazzma12 opened 4 years ago

mazzma12 commented 4 years ago

Hi, when running the tutorial OnnxRuntimeServerSSDModel.ipynb I have this response from the server

response = requests.post(inference_url, headers=request_headers, data=request_message.SerializeToString())
response
> {'error_code': 500, 'error_message': 'No model loaded of that name.'}
inference_url
> 'http://127.0.0.1:9001/v1/models/ssd/versions/1:predict'

I started the onnx server with :

root@588db287a351:/onnxruntime/server# ./onnxruntime_server --model_path
=/onnxruntime/server/ssd.onnx

I could not find any mention of the model_name param. Yet the server logs show no error :

[2019-10-24 14:17:10.114] [04f90999-97b8-44c4-af1f-0b8879e2f74f] [info] Model Name: ssd, Version: 1, Action: predict

Debug

Build docker with Dockerfile from https://github.com/microsoft/onnxruntime/tree/master/dockerfiles and:

docker build -t onnxserver -f Dockerfile.server .

Then run with:

docker run -it -v $PWD:/onnsruntime/server/data -p 9001:8001 --entrypoint bash onnxserver 
# Then
cp data/ssd.onnx .

Any help is appreciated, thank you!

mazzma12 commented 4 years ago

I tried to change the model_path to either absolute or relative because I thought model_name was inferred from the path, but It did not work

Joldnine commented 4 years ago

I have the same issue. Got response: {"error_code": 500, "error_message": "No model loaded of that name."}. Eventually I figure out that, the model name should always be 'default'. You should call

http://127.0.0.1:9001/v1/models/default/versions/1:predict

instead of

http://127.0.0.1:9001/v1/models/ssd/versions/1:predict
adriantorrie commented 4 years ago

I have the same issue. Got response: {"error_code": 500, "error_message": "No model loaded of that name."}. Eventually I figure out that, the model name should always be 'default'. You should call

http://127.0.0.1:9001/v1/models/default/versions/1:predict

instead of

http://127.0.0.1:9001/v1/models/ssd/versions/1:predict

Can confirm using default works for me