代码拉取完成,页面将自动刷新
#
# Check that an ONNX model is valid and well-formed.
#
# Before running this script, install the following:
#
# $ sudo apt-get install protobuf-compiler libprotoc-dev
# $ pip install onnx
#
import onnx
import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument('model', type=str, default='resnet18.onnx', help='path to ONNX model to validate')
args = parser.parse_args(sys.argv[1:])
# Load the ONNX model
model = onnx.load(args.model)
# Print a human readable representation of the graph
print('Network Graph:')
print(onnx.helper.printable_graph(model.graph))
print('')
# Print model metadata
print('ONNX version: ' + onnx.__version__)
print('IR version: {:d}'.format(model.ir_version))
print('Producer name: ' + model.producer_name)
print('Producer version: ' + model.producer_version)
print('Model version: {:d}'.format(model.model_version))
print('')
# Check that the IR is well formed
print('Checking model IR...')
onnx.checker.check_model(model)
print('The model was checked successfully!')
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。