2 import tvm.relay
as relay
6 onnx_model = onnx.load(
'i2_zfnet.onnx')
7 in_shape = (1,3,224,224)
8 shape_dict = {
'gpu_0/data_0': in_shape}
9 mod, params = relay.frontend.from_onnx(onnx_model, shape_dict)
12 with relay.build_config(opt_level=0):
13 graph, lib, params = relay.build(mod, target, params=params)
15 out_lib = open(
"i2_zfnet.ll",
"w")
16 out_lib.write(lib.get_source())
18 out_graph = open(
"i2_zfnet.json",
"w")
19 out_params = open(
"i2_zfnet.params",
"w")
20 out_graph.write(graph)