This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
InferShape Error in softmax's label argument #880
Comments
What's the shape of your label tensor? |
Why do you want multi_output=True if you only have one output? |
I got the same problem. I set the data with label_width=2,,, however, when I train the net, got the message: mxnet.base.MXNetError: InferShape Error in softmax's label argument |
How should I set the inferred shape, the same to the input shape? |
Closing for now due to inactivity. |
4 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This is the structure of my network:
......
cccp6 = mx.symbol.Convolution(data=relu_cccp5, kernel=(1, 1), stride=(1, 1), num_filter=num_classes)
# stage 4
softmax = mx.symbol.SoftmaxOutput(data=cccp6, name='softmax',multi_output=True)
However,when I begin to train my model, I meet such an error:
mxnet.base.MXNetError: InferShape Error in softmax's label argument
Corresponding keyword of symbol: softmax_label
Shape inconsistent, Provided =(128,), inferred shape=(128,1)
What should I do to solve it?
On the other hand, if I set multi_output=False, although this problem disappear, another problem come here:
/mshadow/mshadow/././cuda/tensor_gpu-inl.cuh:281: Check failed: (dst.size(0)) == (label.size(0)) SoftmaxGrad: label shape mismatch (my batch_size=128,so dst.size(0)=256, label.size(0)=128)
The text was updated successfully, but these errors were encountered: