diff --git a/mindspore/ccsrc/minddata/dataset/api/iterator.cc b/mindspore/ccsrc/minddata/dataset/api/iterator.cc index df1b8e7b51..d892135147 100644 --- a/mindspore/ccsrc/minddata/dataset/api/iterator.cc +++ b/mindspore/ccsrc/minddata/dataset/api/iterator.cc @@ -119,9 +119,9 @@ Status Iterator::BuildAndLaunchTree(std::shared_ptr ds) { // Launch the execution tree. RETURN_IF_NOT_OK(tree_->Prepare()); - RETURN_IF_NOT_OK(tree_->Launch()); iterator_ = std::make_unique(tree_); RETURN_UNEXPECTED_IF_NULL(iterator_); + RETURN_IF_NOT_OK(tree_->Launch()); return rc; }