I'm trying out TensorFlow and I'm running into a strange error. I edited the deep MNIST example to use another set of images, and the algorithm converges nicely again, until around iteration 8000 (accuracy 91% at that point) when it crashes with the following error.
tensorflow.python.framework.errors.InvalidArgumentError: ReluGrad input is not finite
At first I thought maybe some coefficients were reaching the limit for a float, but adding l2 regularization on all weights & biases didn't resolve the issue. It's always the first relu application that comes out of the stacktrace:
h_conv1 = tf.nn.relu(conv2d(x_image, W_conv1) + b_conv1)
I'm working on CPU only for now. Any idea what could cause this and how to work around it?
Edit: I traced it down to this problem Tensorflow NaN bug?, the solution there works.
train_step = tf.train.AdamOptimizer(1e-4).minimize(cross_entropy)
I modify the value to 1e-3, the crash occurs significantly earlier. However, changing it to 1e-5 prevents the algorithm from converging. – user1111929 Nov 13 '15 at 19:46epsilon
argument. The current default isepsilon=1e-8
. Look at the documentation. It says "For example, when training an Inception network on ImageNet a current good choice is 1.0 or 0.1." Also see this discussion. – Albert Jul 14 '17 at 11:36