From: Nina Drozd Date: Fri, 28 Aug 2020 16:14:49 +0000 (+0100) Subject: MLECO-1226: update pyarmnn profiling helper utility X-Git-Tag: submit/tizen/20210421.062230~338 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f737c678da7c8e4bf23dc7e7bfdb55407d64dd7c;p=platform%2Fupstream%2Farmnn.git MLECO-1226: update pyarmnn profiling helper utility * fix key error in get_profiling_data * make retrieval of inference measurements more generic Signed-off-by: Nina Drozd Change-Id: I3fc147a6a93830b59e8b12f517be9f9c72370c09 --- diff --git a/python/pyarmnn/src/pyarmnn/_utilities/profiling_helper.py b/python/pyarmnn/src/pyarmnn/_utilities/profiling_helper.py index c6e0718..ecde040 100644 --- a/python/pyarmnn/src/pyarmnn/_utilities/profiling_helper.py +++ b/python/pyarmnn/src/pyarmnn/_utilities/profiling_helper.py @@ -53,8 +53,11 @@ def get_profiling_data(profiler: 'IProfiler') -> ProfilerData: top_level_dict = json.loads(profiler.as_json()) armnn_data = top_level_dict["ArmNN"] - inference_measurements = armnn_data["inference_measurements_#1"] - execution_data = inference_measurements["Execute_#2"] + #Get the inference measurements dict, this will be just one value for key starting with "inference_measurements" + inference_measurements = [v for k, v in armnn_data.items() if k.startswith("inference_measurements_")][0] + + #Get the execution data dict, this will be just one value for key starting with "Execute_" + execution_data = [v for k, v in inference_measurements.items() if k.startswith("Execute_")][0] workload_data = {} inference_data = {}