recommenders icon indicating copy to clipboard operation
recommenders copied to clipboard

ValueError: Shape must be rank 2 but is rank 3

Open yunruili opened this issue 4 years ago • 1 comments

ValueError: Shape must be rank 2 but is rank 3 for '{{node concat}} = ConcatV2[N=2, T=DT_FLOAT, Tidx=DT_INT32](args_0, args_2, concat/axis)' with input shapes: [128,0], [?,128,100], [].

yunruili avatar Nov 19 '21 03:11 yunruili

ValueError: Shape must be rank 2 but is rank 3 for '{{node concat}} = ConcatV2[N=2, T=DT_FLOAT, Tidx=DT_INT32](args_0, args_2, concat/axis)' with input shapes: [128,0], [?,128,100], [].

Hello @yunruili ! It's hard to guess without seeing your code...

Thats sounds to me that you need to add tf.keras.layers.GlobalAveragePooling1D() to one of your models. Usually after create an embeeding coming from a TextVectorization layer.

almirb avatar Nov 26 '21 17:11 almirb