aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Martincigh <matteo.martincigh@arm.com>2019-05-13 09:22:33 +0100
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-05-13 14:16:53 +0100
commit290eb93afaf98ecc1fcc8b417b0b131e4e9b7bbe (patch)
tree1a76a2def7b60e77e8ef69bc6b7b61331d4fdca4
parentb9971c9ede0f344cdbf8ae0ed461e47f2ce7c8a1 (diff)
downloadarmnn-290eb93afaf98ecc1fcc8b417b0b131e4e9b7bbe.tar.gz
IVGCVSW-3058 Segmentation fault running Resnetv2.50 tfite int8 model
* The execution crashed because the weights of a convolution were null during the network execution * Copied the weights and bias when folding a pad layer into a convolution Change-Id: I3ae72143d04cac90d4f878cdf3b1a08b2f2a5c90 Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
-rw-r--r--src/armnn/optimizations/FoldPadIntoConvolution2d.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/armnn/optimizations/FoldPadIntoConvolution2d.hpp b/src/armnn/optimizations/FoldPadIntoConvolution2d.hpp
index f789ffae9a..b2a2ba43ed 100644
--- a/src/armnn/optimizations/FoldPadIntoConvolution2d.hpp
+++ b/src/armnn/optimizations/FoldPadIntoConvolution2d.hpp
@@ -59,6 +59,17 @@ public:
name.c_str());
newConv2dLayer.GetOutputHandler().SetTensorInfo(outInfo);
+ // Copy weights and bias to the new convolution layer
+ BOOST_ASSERT_MSG(convolution2dLayer->m_Weight != nullptr,
+ "FoldPadIntoConvolution2d: Weights data should not be null.");
+ newConv2dLayer.m_Weight = std::move(convolution2dLayer->m_Weight);
+ if (descriptor.m_BiasEnabled)
+ {
+ BOOST_ASSERT_MSG(convolution2dLayer->m_Bias != nullptr,
+ "FoldPadIntoConvolution2d: Bias data should not be null if bias is enabled.");
+ newConv2dLayer.m_Bias = std::move(convolution2dLayer->m_Bias);
+ }
+
// Reconnects with original parent.
newConv2dLayer.GetOutputSlot().MoveAllConnections(*parentOut);
// Parent is now the new convolution2d layer.