diff --git a/python/paddle/io/dataloader/dataloader_iter.py b/python/paddle/io/dataloader/dataloader_iter.py index b212dd42f1dbf76119751d55d5fe3ab1e8ebaaad..0ffe7c46e77c94c33c177a9991d83960508b7de0 100644 --- a/python/paddle/io/dataloader/dataloader_iter.py +++ b/python/paddle/io/dataloader/dataloader_iter.py @@ -752,7 +752,8 @@ class _DataLoaderIterMultiProcess(_DataLoaderIterBase): batch.reraise() if idx == self._rcvd_idx: - del self._task_infos[idx] + if idx in self._task_infos: + del self._task_infos[idx] self._structure_infos.append(structure) return batch else: