From 81fb2f0d1b2f4324deb15fa4da7374de9f2cf2e9 Mon Sep 17 00:00:00 2001 From: Vandana Kannan Date: Wed, 26 Dec 2018 15:58:56 -0800 Subject: [PATCH] Allow multiple output support --- python/mxnet/contrib/onnx/mx2onnx/export_onnx.py | 2 +- tests/python-pytest/onnx/backend_rep.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/python/mxnet/contrib/onnx/mx2onnx/export_onnx.py b/python/mxnet/contrib/onnx/mx2onnx/export_onnx.py index 84db5decd503..d0d4501d89f4 100644 --- a/python/mxnet/contrib/onnx/mx2onnx/export_onnx.py +++ b/python/mxnet/contrib/onnx/mx2onnx/export_onnx.py @@ -146,7 +146,7 @@ def get_outputs(sym, params, in_shape, in_label): if name.endswith('_output'): out_names.append(name[:-len('_output')]) else: - logging.warning("output '%s' does not end with '_output'", name) + logging.info("output '%s' does not end with '_output'", name) out_names.append(name) assert len(out_shapes) == len(out_names) diff --git a/tests/python-pytest/onnx/backend_rep.py b/tests/python-pytest/onnx/backend_rep.py index c5ddcda2e291..be6bc88d9d70 100644 --- a/tests/python-pytest/onnx/backend_rep.py +++ b/tests/python-pytest/onnx/backend_rep.py @@ -82,8 +82,10 @@ def run(self, inputs, **kwargs): args = dict(zip(data_names, data_forward)) exe = self.symbol.bind(ctx, args=args, aux_states=self.aux_params) exe.forward(is_train=False) - result = exe.outputs[0].asnumpy() - return [result] + result = [] + for output in exe.outputs: + result.append(output.asnumpy()) + return result # GluonBackendRep object will be returned by GluonBackend's prepare method which is used to