From abe00dd2fcee1333de0b6eff4771b09bc42370ea Mon Sep 17 00:00:00 2001 From: Alexander Pivovarov Date: Tue, 9 Oct 2018 23:26:18 -0700 Subject: [PATCH] Use new onnx API to load model from file --- nnvm/tests/python/frontend/onnx/test_forward.py | 2 +- nnvm/tests/python/frontend/onnx/test_graph.py | 2 +- tutorials/nnvm/from_onnx.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nnvm/tests/python/frontend/onnx/test_forward.py b/nnvm/tests/python/frontend/onnx/test_forward.py index 187e6c175cd4..7ca520a88b12 100644 --- a/nnvm/tests/python/frontend/onnx/test_forward.py +++ b/nnvm/tests/python/frontend/onnx/test_forward.py @@ -66,7 +66,7 @@ def get_caffe2_output(model, x, dtype='float32'): def verify_onnx_forward_impl(graph_file, data_shape, out_shape): dtype = 'float32' x = np.random.uniform(size=data_shape) - model = onnx.load(graph_file) + model = onnx.load_model(graph_file) c2_out = get_caffe2_output(model, x, dtype) for target, ctx in ctx_list(): tvm_out = get_tvm_output(model, x, target, ctx, out_shape, dtype) diff --git a/nnvm/tests/python/frontend/onnx/test_graph.py b/nnvm/tests/python/frontend/onnx/test_graph.py index 0aad9d22f1be..b3961c1a38fd 100755 --- a/nnvm/tests/python/frontend/onnx/test_graph.py +++ b/nnvm/tests/python/frontend/onnx/test_graph.py @@ -6,7 +6,7 @@ from model_zoo import squeezenet as squeezenet def compare_graph(onnx_file, nnvm_sym, ishape): - onnx_model = onnx.load(onnx_file) + onnx_model = onnx.load_model(onnx_file) onnx_sym, params = nnvm.frontend.from_onnx(onnx_model) g1 = nnvm.graph.create(onnx_sym) g2 = nnvm.graph.create(nnvm_sym) diff --git a/tutorials/nnvm/from_onnx.py b/tutorials/nnvm/from_onnx.py index df8dee8272ce..0fdef8afa98c 100644 --- a/tutorials/nnvm/from_onnx.py +++ b/tutorials/nnvm/from_onnx.py @@ -46,7 +46,7 @@ def download(url, path, overwrite=False): 'super_resolution_0.2.onnx']) download(model_url, 'super_resolution.onnx', True) # now you have super_resolution.onnx on disk -onnx_model = onnx.load('super_resolution.onnx') +onnx_model = onnx.load_model('super_resolution.onnx') # we can load the graph as NNVM compatible model sym, params = nnvm.frontend.from_onnx(onnx_model)