Closed sharmalakshay93 closed 5 years ago
Hi, I'm following this tutorial. Running
L = gluon.loss.SoftmaxCrossEntropyLoss() loss = L(output, labels)
results in the following exception:
mxnet.base.MXNetError: Shape inconsistent, Provided = [100,2], inferred shape=[100,1]
The shapes of the labels and output seem consistent:
labels.shape: (100, 2) output.shape: (100, 2)
The model is defined as follows:
model = mx.gluon.nn.Sequential() with model.name_scope(): model.add(mx.gluon.rnn.LSTM(256, dropout=0.2, layout='NTC')) model.add(mx.gluon.rnn.LSTM(128, dropout=0.2, layout='NTC')) model.add(mx.gluon.nn.Dense(2, flatten=True))
Any clues on what I might be doing incorrectly here? Thanks!
Solved by following this
Hi, I'm following this tutorial. Running
results in the following exception:
The shapes of the labels and output seem consistent:
The model is defined as follows:
Any clues on what I might be doing incorrectly here? Thanks!