diff options
author | Fredrik Svedberg <fredrik.svedberg@arm.com> | 2020-11-16 15:32:25 +0100 |
---|---|---|
committer | patrik.gustavsson <patrik.gustavsson@arm.com> | 2020-11-19 09:28:25 +0000 |
commit | 4bb989b0e0f82ef2bd25c6848cebf51d253e22ae (patch) | |
tree | 771e09a7a40fa5bf766e3b691701dcf65edcb684 /ethosu/vela | |
parent | a648aa9928ba6bd0cca5a6de33c2a3cbbee9a0ed (diff) | |
download | ethos-u-vela-4bb989b0e0f82ef2bd25c6848cebf51d253e22ae.tar.gz |
[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 <fredrik.svedberg@arm.com>
Change-Id: Ib34142f64295de4524e52a7a28eb36e503047bc0
Diffstat (limited to 'ethosu/vela')
-rw-r--r-- | ethosu/vela/tflite_mapping.py | 8 |
1 files 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): |