diff --git a/mindspore/ccsrc/frontend/parallel/strategy_checkpoint/parallel_strategy_checkpoint.cc b/mindspore/ccsrc/frontend/parallel/strategy_checkpoint/parallel_strategy_checkpoint.cc index 3074564a4e..5260f68f37 100644 --- a/mindspore/ccsrc/frontend/parallel/strategy_checkpoint/parallel_strategy_checkpoint.cc +++ b/mindspore/ccsrc/frontend/parallel/strategy_checkpoint/parallel_strategy_checkpoint.cc @@ -59,6 +59,7 @@ Status StrategyCheckpoint::Load(StrategyMap *strategy_map) { MS_LOG(ERROR) << "Load strategy file failed"; return FAILED; } + input.close(); size_t node_num = LongToSize(parallel_strategy_map.parallel_strategy_item_size()); for (size_t i = 0; i < node_num; i++) { straspb::ParallelStrategyItem parallel_strategy_item = parallel_strategy_map.parallel_strategy_item(SizeToLong(i)); @@ -137,6 +138,7 @@ Status StrategyCheckpoint::Save(const StrategyMap &strategy_map, const TensorInf MS_LOG(ERROR) << "Save strategy file failed"; return FAILED; } + output.close(); return SUCCESS; } } // namespace parallel