models icon indicating copy to clipboard operation
models copied to clipboard

MxNet model server missing files question

Open quantum-fusion opened this issue 5 years ago • 6 comments

Ask a Question

Question

Explain your question here.

I want to run the ONNX models using MxNet model server as shown here (https://github.com/onnx/tutorials/blob/master/tutorials/ONNXMXNetServer.ipynb)

However, the procedure to extract these two files is missing.

The missing files needed are: signature.json - defining the input and output of the model synset.txt - defining the set of classes the model was trained on, and returned by the model

Notes

Any additional information, code snippets.

quantum-fusion avatar Aug 05 '20 11:08 quantum-fusion

please create the issue in onnx/tutorials. BTW, the tutorial script includes steps to download those files.

liqunfu avatar Aug 05 '20 18:08 liqunfu

That was not the question, because I need to know how to generate those files.

quantum-fusion avatar Aug 05 '20 18:08 quantum-fusion

However, the procedure to extract these two files is missing.

quantum-fusion avatar Aug 05 '20 18:08 quantum-fusion

Looking at the tutorial, here's an example of the signature.json file and the synset.txt file for the squeezenet model.

We do not provide those two files for every model in the zoo, but (as mentioned in the tutorial) it's easy to create them for other models.

synset.txt is the set of output classes to interpret the model output. signature.json lists the inputs and outputs of the model which can be adjusted for any model from the details in the model README. See example below:

{
  "inputs": [
    {
      "data_name": "input_0",
      "data_shape": [0, 3, 224, 224]
    }
  ],
  "input_type": "image/jpeg",
  "outputs": [
    {
      "data_name": "softmax",
      "data_shape": [0, 1000]
    }
  ],
  "output_type": "application/json"
}

vinitra-zz avatar Aug 06 '20 22:08 vinitra-zz

@vinitra I need you to explain how to create the signature.json and synset.txt files, because I need to be able to create them when they are not available in the model zoo. Do you have the python command and can you provide an example to create these files? I need to be able to do this for any type of ONNX model. Please advise.

quantum-fusion avatar Aug 07 '20 10:08 quantum-fusion

Hi @quantum-fusion -- although I'm not too familiar with the MXNet Server tutorial, I believe those two files (synset.txt and signature.json) were created manually (written by hand after looking at the models). My interpretation of the instructions was to manually change the specified input and output types for any model you would like to serve.

vinitra-zz avatar Aug 10 '20 23:08 vinitra-zz