ValueError: No gradients provided for any variable

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)

What is the best way to implement weight constraints in TensorFlow?

You can take the Lagrangian approach and simply add a penalty for features of the variable you don’t want. e.g. To encourage theta to be non-negative, you could add the following to the optimizer’s objective function. added_loss = -tf.minimum( tf.reduce_min(theta),0) If any theta are negative, then add2loss will be positive, otherwise zero. Scaling that to … Read more

What is the difference between Keras and tf.keras in TensorFlow 1.1+?

tf.keras (formerly tf.contrib.keras) is an implementation of keras 2 implemented exclusively with/for tensorflow. It is hosted on the tensorflow repo and has a distinct code base than the official repo (the last commit there in the tf-keras branch dates back from May 2017). As a rule of thumb, if your code use any tensorflow-specific code, … Read more

Visualizing output of convolutional layer in tensorflow

I don’t know of a helper function but if you want to see all the filters you can pack them into one image with some fancy uses of tf.transpose. So if you have a tensor that’s images x ix x iy x channels >>> V = tf.Variable() >>> print V.get_shape() TensorShape([Dimension(-1), Dimension(256), Dimension(256), Dimension(32)]) So … Read more

Tensorflow: loss decreasing, but accuracy stable

A decrease in binary cross-entropy loss does not imply an increase in accuracy. Consider label 1, predictions 0.2, 0.4 and 0.6 at timesteps 1, 2, 3 and classification threshold 0.5. timesteps 1 and 2 will produce a decrease in loss but no increase in accuracy. Ensure that your model has enough capacity by overfitting the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)