3

I am using tensorflow (CPU version only) under python 3.5.2 within anaconda 4.3.1 (64-bit) in Windows 7 Operation System. When I run the following code, the python kernel died and could not restart with some errors but no error information prompt.

print ("test accuracy %.3f" % accuracy.eval(feed_dict={  
    x: mnist.test.images, y_: mnist.test.labels, keep_prob: 1.0}))

But when I run the similar codes, python works normally:

train_accuracy = accuracy.eval(feed_dict={  
    x:batch[0], y_: batch[1], keep_prob: 1.0}) 

Which reason could cause this problem?

Maxim
  • 52,561
  • 27
  • 155
  • 209
Light
  • 141
  • 1
  • 10

1 Answers1

2

I'm not sure that mnist actually holds, but looks like you are pushing the whole test set for evaluation, which is 10 000 images. Even for a medium size neural network it's a lot. The process is likely to die with OOM.

Try to pass a smaller batch, say of size 100.

Maxim
  • 52,561
  • 27
  • 155
  • 209