diff options
-rw-r--r-- | src/armnn/Network.cpp | 3 | ||||
-rw-r--r-- | src/backends/backendsCommon/test/layerTests/DebugTestImpl.cpp | 3 | ||||
-rw-r--r-- | src/backends/reference/workloads/Debug.cpp | 5 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/armnn/Network.cpp b/src/armnn/Network.cpp index bb6eb19fa3..d3ce7ab62c 100644 --- a/src/armnn/Network.cpp +++ b/src/armnn/Network.cpp @@ -11,6 +11,7 @@ #include "SubgraphViewSelector.hpp" #include "BackendSettings.hpp" #include "optimizations/All.hpp" +#include "armnnUtils/Filesystem.hpp" #include <armnn/backends/TensorHandle.hpp> #include <armnn/backends/WorkloadFactory.hpp> @@ -1816,6 +1817,8 @@ IOptimizedNetworkPtr Optimize(const Graph& inGraph, } else if (options.m_DebugToFile) { + // Setup the output file path + armnnUtils::Filesystem::CreateDirectory("/ArmNNIntermediateLayerOutputs"); Optimizer::Pass(optGraph, MakeOptimizations(InsertDebugToFileLayer())); } diff --git a/src/backends/backendsCommon/test/layerTests/DebugTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/DebugTestImpl.cpp index fa9a825313..e2fa8dbf5a 100644 --- a/src/backends/backendsCommon/test/layerTests/DebugTestImpl.cpp +++ b/src/backends/backendsCommon/test/layerTests/DebugTestImpl.cpp @@ -70,7 +70,10 @@ LayerTestResult<T, Dim> DebugTestImpl( if (toFile) { + // Given that this is dependent on an ExNet switch, we need to explicitly set the directory that the + // files are stored in as this happens within the ExNet flow fs::path tmpDir = fs::temp_directory_path(); + armnnUtils::Filesystem::CreateDirectory("/ArmNNIntermediateLayerOutputs"); std::string full_path = tmpDir.generic_string() + "/ArmNNIntermediateLayerOutputs/" + layerName + ".numpy"; ExecuteWorkload(*workload, memoryManager); diff --git a/src/backends/reference/workloads/Debug.cpp b/src/backends/reference/workloads/Debug.cpp index fdadfef590..f4f9792fc1 100644 --- a/src/backends/reference/workloads/Debug.cpp +++ b/src/backends/reference/workloads/Debug.cpp @@ -103,9 +103,10 @@ void Debug(const TensorInfo& inputInfo, { if (outputsToFile) { - auto rootPathToFile = armnnUtils::Filesystem::CreateDirectory("/ArmNNIntermediateLayerOutputs"); - std::ofstream out(rootPathToFile + layerName + ".numpy"); + fs::path tmpDir = fs::temp_directory_path(); + std::ofstream out(tmpDir.generic_string() + "/ArmNNIntermediateLayerOutputs/" + layerName + ".numpy"); PrintOutput<T>(inputInfo, inputData, guid, layerName, slotIndex, out); + out.close(); } else { |