Hyperspectral icon indicating copy to clipboard operation
Hyperspectral copied to clipboard

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

Open bernt73 opened this issue 6 years ago • 3 comments

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

bernt73 avatar Jul 30 '18 08:07 bernt73

I get this same issue but when I am using CNN

cullinap avatar Dec 16 '18 20:12 cullinap

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

cullinap avatar Dec 22 '18 13:12 cullinap

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)).

Linkersem avatar May 25 '19 06:05 Linkersem