diff options
author | Colm Donelan <colm.donelan@arm.com> | 2023-01-16 16:45:08 +0000 |
---|---|---|
committer | Colm Donelan <colm.donelan@arm.com> | 2023-01-18 11:45:06 +0000 |
commit | e27983ccfc9f73e2ec69863dcc5d9812fba7f5ef (patch) | |
tree | 48da418fa5adad68ef95a486cfb76f7b93bd9de6 /src/armnn | |
parent | 23a6d00339f2310dd2973e47d95b9c0d7b8d9bde (diff) | |
download | armnn-e27983ccfc9f73e2ec69863dcc5d9812fba7f5ef.tar.gz |
IVGCVSW-7405 Improving error handling around creating directories.
The -F execute network option creates a directory to print intermediate
tensors but minor problems caused serious failures. This attempts
to clean up the error handling.
Signed-off-by: Colm Donelan <colm.donelan@arm.com>
Change-Id: Ia44c008919b1bee299b43a672235b1fcc25bf1bd
Diffstat (limited to 'src/armnn')
-rw-r--r-- | src/armnn/Network.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/armnn/Network.cpp b/src/armnn/Network.cpp index 42388bfbd7..e81b87b382 100644 --- a/src/armnn/Network.cpp +++ b/src/armnn/Network.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2017,2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2017,2022,2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -1731,8 +1731,17 @@ IOptimizedNetworkPtr Optimize(const Graph& inGraph, else if (options.m_DebugToFile) { // Setup the output file path - armnnUtils::Filesystem::CreateDirectory("/ArmNNIntermediateLayerOutputs"); - Optimizer::Pass(optGraph, MakeOptimizations(InsertDebugToFileLayer())); + try + { + auto result = armnnUtils::Filesystem::CreateDirectory("/ArmNNIntermediateLayerOutputs"); + ARMNN_LOG(info) << "Intermediate tensors will be written to: " << result; + Optimizer::Pass(optGraph, MakeOptimizations(InsertDebugToFileLayer())); + } + catch (const armnn::RuntimeException& e) + { + // If we cannot create the output directory then we'll issue a warning and continue. + ARMNN_LOG(warning) << "Unable to print intermediate layer outputs : " << e.what(); + } } // Calculate the compatibility strategies for tensor handles |