diff --git a/mindspore/ccsrc/utils/summary.proto b/mindspore/ccsrc/utils/summary.proto index c0d8001002..b3cb0c6795 100644 --- a/mindspore/ccsrc/utils/summary.proto +++ b/mindspore/ccsrc/utils/summary.proto @@ -130,7 +130,7 @@ message Explain { repeated string benchmark_method = 3; } - optional string image_id = 1; // The Metadata and image id must have one fill in + optional string image_id = 1; // The Metadata and image id and benchmark must have one fill in optional bytes image_data = 2; repeated int32 ground_truth_label = 3; diff --git a/mindspore/train/callback/_summary_collector.py b/mindspore/train/callback/_summary_collector.py index 630c047fcc..4e9bdc9d6c 100644 --- a/mindspore/train/callback/_summary_collector.py +++ b/mindspore/train/callback/_summary_collector.py @@ -453,10 +453,16 @@ class SummaryCollector(Callback): if not self._collect_specified_data.get('collect_input_data'): return + if self._dataset_sink_mode: + self._collect_specified_data['collect_input_data'] = False + logger.warning('SummaryCollector is not supported to record input data in dataset sink mode.') + return + input_data = getattr(cb_params, 'train_dataset_element', None) if input_data is None: self._collect_specified_data['collect_input_data'] = False - logger.info("The 'train_dataset_element' in cb_params is None, maybe there is dataset sink mode.") + logger.info("The 'train_dataset_element' in cb_params is None, " + "so 'SummaryCollector' will not record the input data.") return if isinstance(input_data, (list, tuple)) and input_data: @@ -464,8 +470,7 @@ class SummaryCollector(Callback): try: self._record.add_value(PluginEnum.IMAGE.value, 'input_data/auto', input_data) except (TypeError, ValueError): - if not self._dataset_sink_mode: - logger.warning('The input data of network are not image, so will not collect by SummaryCollector.') + logger.warning('The input data of network are not image, so will not collect by SummaryCollector.') self._collect_specified_data['collect_input_data'] = False return