From b4bb5a798925775ce0d6f3c0ba17bf5b2da4b966 Mon Sep 17 00:00:00 2001 From: Parastoo Ashtari Date: Wed, 22 Sep 2021 10:12:42 -0400 Subject: [PATCH] add safety check for LoadParametersAndConst --- mindspore/ccsrc/debug/debugger/debugger.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mindspore/ccsrc/debug/debugger/debugger.cc b/mindspore/ccsrc/debug/debugger/debugger.cc index 6b0c63bc967..f2963304f77 100644 --- a/mindspore/ccsrc/debug/debugger/debugger.cc +++ b/mindspore/ccsrc/debug/debugger/debugger.cc @@ -433,9 +433,11 @@ void Debugger::PostExecuteGraphDebugger() { if (device_target_ != kGPUDevice) { return; } - // LoadParametersAndConst for all the graphs - for (auto graph : graph_ptr_step_vec_) { - debugger_->LoadParametersAndConst(graph); + // LoadParametersAndConst for all the graphs that have been run in the current step + if (debugger_) { + for (auto graph : graph_ptr_step_vec_) { + debugger_->LoadParametersAndConst(graph); + } } // debug used for dump if (debugger_ && debugger_->CheckDebuggerDumpEnabled()) { @@ -644,7 +646,7 @@ bool Debugger::SendMetadata(bool version_check) { metadata.set_training_done(training_done_); metadata.set_ms_version(version_); MS_LOG(INFO) << "Is training done?" << training_done_; - // set graph munber to not_dataset_graph_sum_ + // set graph number to not_dataset_graph_sum_ metadata.set_graph_num(not_dataset_graph_sum_); MS_EXCEPTION_IF_NULL(grpc_client_);