Hi,
I am working on NLP LSTM model but getting this error
input sentence : [123 88 170 221 132 52 105 32 211 91 126 211 24 221 134 154 221 162
215 80 144 101 61 136 68 133 40 200 133 40 218 131 139 199 124 74
184 92 213 185 221 221 221 221 221 221 221 221 221 221]
output sentece label: [ 7 7 7 7 0 7 6 2 7 5 1 7 7 7 7 7 7 7 7 10 7 7 7 7
3 8 7 3 8 7 7 7 7 7 7 7 7 6 2 7 7 7 7 7 7 7 7 7
7 7]
Both input and output are of length 50
If I use loss function as “categorical_crossentropy” , i get this error:
ValueError: Shapes (None, 50) and (None, 11) are incompatible
If I use loss function as “sparse_categorical_crossentropy” , i get this error:
logits and labels must have the same first dimension, got logits shape [13,11] and labels shape [650]
[[{{node sparse_categorical_crossentropy/SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits}}]]
I tried adding input shape as first layer but still no luck
tf.keras.layers.Input(shape=(max_len,))
Can anyone help , how to solve this problem.