diff --git a/x2paddle/decoder/tf_decoder.py b/x2paddle/decoder/tf_decoder.py index 97c5d486bc87feb807504c7bb9aa79c94e98beff..089be82db65747aefd108fec40de083f89aaa27c 100644 --- a/x2paddle/decoder/tf_decoder.py +++ b/x2paddle/decoder/tf_decoder.py @@ -341,9 +341,12 @@ class TFDecoder(object): need_define_shape = 2 if need_define_shape == 1: - shape = graph_node.out_shapes[0] - if len(shape) > 0 and shape.count(-1) < 2: - need_define_shape = 0 + try: + shape = graph_node.out_shapes[0] + if len(shape) > 0 and shape.count(-1) < 2: + need_define_shape = 0 + except: + pass if need_define_shape > 0: shape = None