add safety check for LoadParametersAndConst

This commit is contained in:
Parastoo Ashtari 2021-09-22 10:12:42 -04:00
parent 7c9ecff30b
commit b4bb5a7989
1 changed files with 6 additions and 4 deletions

View File

@ -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_);