ValueError: No gradients provided for any variable

后端 未结 1 1662
忘掉有多难
忘掉有多难 2020-12-16 13:59

I\'m facing a trouble with tensorFlow. Executing the following code

import tensorflow as tf
import input_data

learning_rate = 0.01
training_epochs = 25
bat         


        
相关标签:
1条回答
  • 2020-12-16 14:21

    This problem is caused by the following line: tf.nn.softmax_cross_entropy_with_logits(labels=activation, logits=Y)

    Based on documentation you should have

    labels: Each row labels[i] must be a valid probability distribution.

    logits: Unscaled log probabilities.

    So logits suppose to be your hypothesis and thus equal to activation and valid probability distribution is Y. So just change it with tf.nn.softmax_cross_entropy_with_logits(labels=Y, logits=activation)

    0 讨论(0)
提交回复
热议问题