Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def to_IR_json(model_pb_path):
model = onnx.load(model_pb_path)
graph = model.graph
del graph.initializer[:]
# to json string
json_str = MessageToJson(model.graph)
model_json = json.loads(json_str)
reorganize_inout(model_json, 'input')
reorganize_inout(model_json, 'output')
return model_json