From f737c678da7c8e4bf23dc7e7bfdb55407d64dd7c Mon Sep 17 00:00:00 2001 From: Nina Drozd Date: Fri, 28 Aug 2020 17:14:49 +0100 Subject: 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 --- python/pyarmnn/src/pyarmnn/_utilities/profiling_helper.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'python/pyarmnn/src') diff --git a/python/pyarmnn/src/pyarmnn/_utilities/profiling_helper.py b/python/pyarmnn/src/pyarmnn/_utilities/profiling_helper.py index c6e0718722..ecde040d81 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 = {} -- cgit v1.2.1