Browse Source

!1153 BugFix: Summary file list not found

From: @lixiaohui33
Reviewed-by: @ouwenchang,@wangyue01
Signed-off-by: @wangyue01
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 4 years ago
parent
commit
03ed463cb7
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      mindinsight/datavisual/data_transform/summary_watcher.py

+ 6
- 2
mindinsight/datavisual/data_transform/summary_watcher.py View File

@@ -1,4 +1,4 @@
# Copyright 2020 Huawei Technologies Co., Ltd
# Copyright 2020-2021 Huawei Technologies Co., Ltd
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@@ -205,6 +205,7 @@ class SummaryWatcher:
if not self._is_valid_pattern_result(summary_pattern, pb_pattern, list_explain, entry): if not self._is_valid_pattern_result(summary_pattern, pb_pattern, list_explain, entry):
return return
timestamp = None
if summary_pattern is not None: if summary_pattern is not None:
timestamp = int(summary_pattern.groupdict().get('timestamp')) timestamp = int(summary_pattern.groupdict().get('timestamp'))
try: try:
@@ -215,7 +216,6 @@ class SummaryWatcher:
if relative_path not in summary_dict: if relative_path not in summary_dict:
summary_dict[relative_path] = _new_entry(ctime, mtime) summary_dict[relative_path] = _new_entry(ctime, mtime)
job_dict = _get_explain_job_info(summary_base_dir, relative_path, timestamp) job_dict = _get_explain_job_info(summary_base_dir, relative_path, timestamp)
summary_dict[relative_path].update(job_dict) summary_dict[relative_path].update(job_dict)
@@ -488,6 +488,10 @@ def _new_entry(ctime, mtime, profiler=None):
def _get_explain_job_info(summary_base_dir, relative_path, timestamp): def _get_explain_job_info(summary_base_dir, relative_path, timestamp):
"""Get explain job info.""" """Get explain job info."""
if timestamp is None:
job_dict = {"saliency_map": False, "hierarchical_occlusion": False}
return job_dict
json_path = os.path.join(summary_base_dir, relative_path.lstrip("./"), f"_explain_{timestamp}", json_path = os.path.join(summary_base_dir, relative_path.lstrip("./"), f"_explain_{timestamp}",
"manifest.json") "manifest.json")
if os.path.exists(json_path): if os.path.exists(json_path):


Loading…
Cancel
Save