I have a simple RNN with BATCH x SEQUENCE x FEATURES as input data shape.
My loss is the softmax cross entropy loss and my output as well as my label is [32, 2] (BATCH x FEATURES) but i always get “Shape inconsistent, Provided [32, 2], inferred shape [32, 1]”. I have 2 classes and my labels are all [0, 1] or [1, 0].
The documentation says that the “label‘s shape should be pred‘s shape”, so what did I do wrong?
x = x.as_in_context(ctx)
print(x.shape) # 32, 10, 15
y = y.as_in_context(ctx)
print(y.shape) # 32, 2
output = net(x)
print(output.shape) # 32, 2
loss = l_cross_entropy(output, y)