diff --git a/python/paddle/v2/inference.py b/python/paddle/v2/inference.py index 2860f18e195d9ce05a23e2bb1c24ba8924348caa..3210bf0642cda53cded52d7c38a8770e36290c19 100644 --- a/python/paddle/v2/inference.py +++ b/python/paddle/v2/inference.py @@ -49,7 +49,7 @@ class Inference(object): retv = None for result in self.iter_infer_field(field=field, **kwargs): if retv is None: - retv = [[]] * len(result) + retv = [[] for i in xrange(len(result))] for i, item in enumerate(result): retv[i].append(item) retv = [numpy.concatenate(out) for out in retv]