multi-model-server
multi-model-server copied to clipboard
ONNX to .mar conversion
Hey guys, great library.
I'm having trouble converting a ONNX model to the .mar format using the steps outlined here:
https://github.com/awslabs/mxnet-model-server/blob/f8845f917187957d0ae44c6a44b8fecec6746811/model-archiver/docs/convert_from_onnx.md
The .mar file is created but every time I attempt inference, my backend workers will die due to onnx-squeezenet-symbol.json not being found.
Here is the exact error:
mxnet.base.MXNetError: [22:32:47] src/io/local_filesys.cc:199: Check failed: allow_null LocalFileSystem::Open "/home/model-server/tmp/models/788e08a42eec410e09f18c0426ba2ca9fd513b64/onnx-squeezenet-symbol.json": No such file or directory
Let me know if you want more details.
From my understanding, when we archive a model we typically need these files to define the model/weights:
- squeezenet_v1.1-symbol.json
- squeezenet_v1.1-0000.params
For the ONNX representation, since the model has the .onnx extension, it will be detected and the converted to mxnet models accordingly without the need for the symbol and params files.
However obviously as with the above error, it seems like this is not the case? Is it a bug in the model-archiver?
Morning team,
Any update for the above? @vdantu
Steve
Model archiver needs an additional -c
flag to convert ONNX models to MXNet models. Added a small fix in the documents.
It appears that the -c option produces an error.
model-archiver -c --model-name onnx-squeezenet --model-path ./my_model --handler mxnet_vision_service:handle
ERROR - Failed to write the signature or symbol files for squeezenet.onnx model
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/bin/model-archiver", line 8, in
without the -c option the command works just fine. model-archiver —model-name onnx-squeezenet —model-path ./my_model —handler mxnet_vision_service:handle