diff --git a/mindinsight/profiler/profiling.py b/mindinsight/profiler/profiling.py index 542b3de9a21e34ff5dcca57ec1560acc69c7ae08..5a28eba4faaf90e44b6563720f70e2440d1ba4fd 100644 --- a/mindinsight/profiler/profiling.py +++ b/mindinsight/profiler/profiling.py @@ -136,10 +136,6 @@ class Profiler: logger.error("Profiling: fail to import release from mindspore.") job_id = self._get_profiling_job_id() - if not job_id: - msg = ("Fail to get profiling job, please check whether job dir was generated") - raise RuntimeError(msg) - logger.info("Profiling: job id is %s ", job_id) source_path = os.path.join(PROFILING_LOG_BASE_PATH, job_id) @@ -180,9 +176,7 @@ class Profiler: # parse minddata pipeline operator and queue try: - pipeline_parser = MinddataPipelineParser( - self._output_path, self._dev_id, self._output_path - ) + pipeline_parser = MinddataPipelineParser(self._output_path, self._dev_id, self._output_path) pipeline_parser.parse() except MindInsightException as err: logger.warning(err.message) @@ -314,6 +308,10 @@ class Profiler: job_id = item.strip() break + if not job_id: + msg = ("Fail to get profiling job, please check whether job dir was generated") + raise RuntimeError(msg) + return job_id def _parse_host_start_log(self, input_file):