gmalivenko / onnx2keras

Convert ONNX model graph to Keras model format.
MIT License
193 stars 115 forks source link

onnx2keras #18

Open Harikrishnah007 opened 4 years ago

Harikrishnah007 commented 4 years ago

import onnx from onnx2keras import onnx_to_keras

Load ONNX model

onnx_model = onnx.load('resnet18.onnx')

Call the converter (input - is the main model input name, can be different for your model)

k_model = onnx_to_keras(onnx_model, ['input'])

In the above code could you please any one specify ['input'] stands for... or from where we can get the 'input' parameter from our onnx model.

Thank you

emanuelcovaci commented 4 years ago

Hi @Harikrishnah007,

You can use Netron to visualize the network, and the first layer in the graph it's your input layer and from there get the name.

e.g.: https://ibb.co/sKnbxWY The first layer it's 'input_1' that means for conversion you will call the function onnx_to_keras(onnx_model, ['input_1'])