diff --git a/mindspore/OWNERS b/mindspore/OWNERS index 00e772840b..1e7a4633e4 100644 --- a/mindspore/OWNERS +++ b/mindspore/OWNERS @@ -6,5 +6,4 @@ approvers: - stsuteng - c_34 - liangchenghui -- wuxuejian -- yelihua +- wuxuejian \ No newline at end of file diff --git a/mindspore/ccsrc/debug/debug_services.cc b/mindspore/ccsrc/debug/debug_services.cc index de6330e63a..c7e50637a5 100644 --- a/mindspore/ccsrc/debug/debug_services.cc +++ b/mindspore/ccsrc/debug/debug_services.cc @@ -390,7 +390,7 @@ void DebugServices::ReadTensorFromNpy(const std::string &file_name, std::string } uint64_t file_size = infile.tellg(); infile.seekg(0, std::ios::beg); - std::unique_ptr> buffer(new std::vector(file_size)); + auto buffer = std::make_unique>(file_size); if (!infile.read(buffer->data(), file_size)) { MS_LOG(ERROR) << "Failed to read file (In ReadTensorFromNpy) " << file_path; return; @@ -413,7 +413,7 @@ void DebugServices::ReadTensorFromNpy(const std::string &file_name, std::string std::size_t data_size = data_len * word_size; infile.seekg(header_len + 10); *data_buffer = new std::vector(data_size); - if (!infile.read((*data_buffer)->data(), data_size)) { + if (data_buffer == nullptr || !infile.read((*data_buffer)->data(), data_size)) { MS_LOG(ERROR) << "Unable to get tensor data from npy"; } *size = data_size; diff --git a/mindspore/ccsrc/debug/debugger/offline_debug/dbg_services.cc b/mindspore/ccsrc/debug/debugger/offline_debug/dbg_services.cc index e0ac04856c..c7a52b8c16 100644 --- a/mindspore/ccsrc/debug/debugger/offline_debug/dbg_services.cc +++ b/mindspore/ccsrc/debug/debugger/offline_debug/dbg_services.cc @@ -55,6 +55,10 @@ int32_t DbgServices::Initialize(std::string net_name, std::string dump_folder_pa MS_LOG(INFO) << "cpp DbgServices initialize network name " << net_name; MS_LOG(INFO) << "cpp DbgServices initialize dump folder path " << dump_folder_path; MS_LOG(INFO) << "cpp DbgServices initialize sync mode " << is_sync_mode; + if (debug_services == nullptr) { + MS_LOG(EXCEPTION) << "Debugger services initialize failed as occur null pointer error," + << "may be due to memory allocation failure, check as: top"; + } debug_services->SetNetName(net_name); debug_services->SetDumpDir(dump_folder_path); debug_services->SetSyncMode(is_sync_mode); diff --git a/mindspore/train/OWNERS b/mindspore/train/OWNERS new file mode 100644 index 0000000000..2732da9ece --- /dev/null +++ b/mindspore/train/OWNERS @@ -0,0 +1,6 @@ +approvers: +- ougongchang +- yelihua +- lilongfei15 +- wangyue01 +- wenkai_distq \ No newline at end of file diff --git a/mindspore/train/summary/_summary_adapter.py b/mindspore/train/summary/_summary_adapter.py index 495eeca703..c14a4aacd1 100644 --- a/mindspore/train/summary/_summary_adapter.py +++ b/mindspore/train/summary/_summary_adapter.py @@ -360,6 +360,11 @@ def _fill_image_summary(tag: str, np_value, summary_image, input_format='NCHW'): f"The tensor with dim({np_value.ndim}) can't convert the format({input_format}) because dim not same") return False + if 0 in np_value.shape: + logger.error( + f"The tensor with shape({np_value.shape}) is not a valid image because the shape contains zero.") + return False + # convert the tensor format tensor = _convert_image_format(np_value, input_format)