Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ValueError: Only call sparse_softmax_cross_entropy_with_logits with named arguments" encountered in the training loop #15

Open
bernt73 opened this issue Jul 30, 2018 · 3 comments

Comments

@bernt73
Copy link

bernt73 commented Jul 30, 2018

Hi,

I'm using TF1.3 with Cuda 8.0 and CuDNN 6.0. May I know if this error could be caused by incompatible Tensorflow version? If so, could you share with us the version of TF/Cuda/CuDnn that you used to run the code?

image

@cullinap
Copy link

I get this same issue but when I am using CNN

@cullinap
Copy link

What I did to make it work was the following:
image

@Linkersem
Copy link

after this, i met another question,do you also has this question? or could you tell me how to solve this?

Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\test\CNN_G.py", line 257, in
run_training()
File "C:\Users\Administrator\Desktop\test\CNN_G.py", line 166, in run_training
loss = IndianPinesCNN.loss(logits, labels_placeholder)
File "C:\Users\Administrator\Desktop\test\IndianPinesCNN.py", line 135, in loss
logits=logits,labels=labels, name='xentropy')
File "E:\python3.5\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 2653, in sparse_softmax_cross_entropy_with_logits
logits.get_shape()))
ValueError: Shape mismatch: The shape of labels (received (100,)) should equal the shape of logits except for the last dimension (received (225, 16)).

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

No branches or pull requests

3 participants