From 99ed791962d822d0b8b5603537be6bbf87d67521 Mon Sep 17 00:00:00 2001 From: liutuo Date: Wed, 26 Dec 2018 19:10:47 +0800 Subject: [PATCH] fix fold fc reshape --- mace/python/tools/converter_tool/transformer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mace/python/tools/converter_tool/transformer.py b/mace/python/tools/converter_tool/transformer.py index 657d3445..ca0d3e2a 100644 --- a/mace/python/tools/converter_tool/transformer.py +++ b/mace/python/tools/converter_tool/transformer.py @@ -1786,7 +1786,8 @@ class Transformer(base_converter.ConverterInterface): net = self._model for op in net.op: # whether to reshape fc output(default 4D) - if op.type == MaceOp.FullyConnected.name: + if op.type == MaceOp.FullyConnected.name and\ + op.output[0] in self._consumers: consumers = self._consumers[op.output[0]] op_output_shape = op.output_shape[0].dims[:] for consumer in consumers: -- GitLab