diff --git a/paddle/fluid/operators/reader/open_files_op.cc b/paddle/fluid/operators/reader/open_files_op.cc index 2cbae8a90a96183cc3fa95e66c48b341086b6b6d..31e5d81e55ed9703eb3a9ef2595fa2a280f1a734 100644 --- a/paddle/fluid/operators/reader/open_files_op.cc +++ b/paddle/fluid/operators/reader/open_files_op.cc @@ -63,9 +63,6 @@ void MultiFileReader::ReadNext(std::vector* out) { void MultiFileReader::ReInit() { EndScheduler(); - for (auto& reader : readers_) { - reader->ReInit(); - } StartNewScheduler(); } @@ -141,6 +138,7 @@ void MultiFileReader::PrefetchThreadFunc(size_t reader_idx, size_t thread_idx) { std::vector ins; reader->ReadNext(&ins); if (ins.empty()) { + reader->ReInit(); break; } try {