Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

InferShape Error in softmax's label argument #880

Closed
zhaofan0622 opened this issue Dec 9, 2015 · 5 comments
Closed

InferShape Error in softmax's label argument #880

zhaofan0622 opened this issue Dec 9, 2015 · 5 comments

Comments

@zhaofan0622
Copy link

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)

@jermainewang
Copy link
Contributor

What's the shape of your label tensor?

@jermainewang jermainewang self-assigned this Dec 9, 2015
@piiswrong
Copy link
Contributor

Why do you want multi_output=True if you only have one output?

@luxiangju
Copy link

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
Corresponding keyword of symbol: softmax_label
Shape inconsistent, Provided =(192,2), inferred shape=(192,1)

@luxiangju
Copy link

How should I set the inferred shape, the same to the input shape?

@pluskid
Copy link
Contributor

pluskid commented Oct 19, 2016

Closing for now due to inactivity.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants