From 4bb989b0e0f82ef2bd25c6848cebf51d253e22ae Mon Sep 17 00:00:00 2001 From: Fredrik Svedberg Date: Mon, 16 Nov 2020 15:32:25 +0100 Subject: [MLBEDSW-3348] Fix Reshape operator fails with TypeError during deserialization Fixed Reshape operator fails with TypeError during deserialization in some cases. Signed-off-by: Fredrik Svedberg Change-Id: Ib34142f64295de4524e52a7a28eb36e503047bc0 --- ethosu/vela/tflite_mapping.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ethosu/vela/tflite_mapping.py b/ethosu/vela/tflite_mapping.py index ea9e8a36..20521e41 100644 --- a/ethosu/vela/tflite_mapping.py +++ b/ethosu/vela/tflite_mapping.py @@ -367,8 +367,12 @@ class OptionsSerializer: if is_vector: fun += "AsNumpy" - a = deserialize(getattr(tfattrs, fun)()) - attrs[underscore_mem] = a + attr = getattr(tfattrs, fun)() + try: + attrs[underscore_mem] = deserialize(attr) + except TypeError: + print("Warning: {0} could not read attribute '{1}'.".format(self.name, underscore_mem)) + return attrs def serialize(self, builder, attrs): -- cgit v1.2.1