Skip to content

Commit 7e0144b

Browse files
authored
Update tflite_utils.py
1 parent ddca3a5 commit 7e0144b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tf2onnx/tflite_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,9 @@ def shape_to_tf_shape(dims):
482482
output_shapes[out] = None
483483
if has_prequantized_output:
484484
output_names = [get_prequant(out) for out in output_names]
485-
onnx_node = helper.make_node(optype, input_names, output_names, name=output_names[0], **attr)
486-
onnx_nodes.append(onnx_node)
485+
if len(output_names) > 0: # to try to hackily work around this error: https://github.com/onnx/tensorflow-onnx/issues/2055
486+
onnx_node = helper.make_node(optype, input_names, output_names, name=output_names[0], **attr)
487+
onnx_nodes.append(onnx_node)
487488

488489
inputs = [tensor_names[tflite_g.Inputs(i)] for i in range(tflite_g.InputsLength())]
489490
outputs = [tensor_names[tflite_g.Outputs(i)] for i in range(tflite_g.OutputsLength())]

0 commit comments

Comments
 (0)