79509743

Date: 2025-03-14 16:56:56
Score: 1
Natty:
Report link

Adding the follwing layer after inputs solves the issue by force reshaping inputs, as suggested in the comments:

class ReshapeLayer(keras.layers.Layer):
    def __init__(self, **kwargs):
        super(ReshapeLayer, self).__init__(**kwargs)

    def build(self):
        pass

    def call(self, inputs):
        return tf.expand_dims(inputs, axis=-1)
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: The_Docc