From 6f41cc251bf9dcf187aaa859707c193bda0992d9 Mon Sep 17 00:00:00 2001 From: chenchao99 Date: Thu, 11 Jun 2020 15:36:42 +0800 Subject: [PATCH] fix the framework parsing bug, when the op has no task attribute --- mindinsight/profiler/parser/framework_parser.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mindinsight/profiler/parser/framework_parser.py b/mindinsight/profiler/parser/framework_parser.py index d8331fa..a8e80d7 100644 --- a/mindinsight/profiler/parser/framework_parser.py +++ b/mindinsight/profiler/parser/framework_parser.py @@ -435,9 +435,14 @@ class FrameworkParser: for graph_info in graph_file: result = self._parse_one_row_graph_info(graph_info) task_info = task_cache.get(result[0]) - task_info.extend(result) - csv_writer.writerow(task_info) - del task_cache[result[0]] + if task_info: + task_info.extend(result) + csv_writer.writerow(task_info) + del task_cache[result[0]] + else: + save_info = [None, None, None] + save_info.extend(result) + csv_writer.writerow(save_info) none_list = [None, None, None, None] for key, value in task_cache.items(): -- GitLab