The parsing error was caused because the code presents each 2D tensor as a single byte string using tf.io.serialize_tensor
, but the parsing schema was set to expect a fixed-length array of strings. To fix this, change the FixedLenFeature to expect a single scalar string, which will then be correctly decoded by tf.io.parse_tensor
. Kindly refer to the gist for working code.