onnx / models

A collection of pre-trained, state-of-the-art models in the ONNX format
http://onnx.ai/models/
Apache License 2.0
7.47k stars 1.36k forks source link

MxNet model server missing files question #348

Open quantum-fusion opened 3 years ago

quantum-fusion commented 3 years ago

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.

liqunfu commented 3 years ago

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

quantum-fusion commented 3 years ago

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

quantum-fusion commented 3 years ago

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

vinitra-zz commented 3 years ago

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"
}
quantum-fusion commented 3 years ago

@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.

vinitra-zz commented 3 years ago

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.