title: Using tensorflow in ML, why my kernel restarts constantly?
body: <p>from the kernel :</p>
  <pre><code>In[1]: runfile('/home/yannick/Documents/ML/MNIST-reco/neural_network_V1.py', wdir='/home/yannick/Documents/ML/MNIST-reco')
  
  Restarting kernel...    
  
  In [1]:  
  </code></pre>
  <p>The thing is that when i run the code, instead of working, it restarts the kernel and nothing happends
  please help me</p>
  <pre><code>import tensorflow as tf
  import input_data
  import matplotlib.pyplot as plt
  import matplotlib.cm as cm
  
  config = tf.ConfigProto()
  config.gpu_options.allow_growth = True
  sess = tf.Session(config=config)
  
  mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
  
  img = mnist.train.images[0]
  img = img.reshape((28,28))
  plt.imshow(img, cmap=cm.Greys)
  plt.show()
  
  x = tf.placeholder(tf.float32, [None, 784])
  y_ = tf.placeholder(tf.float32, [None, 10])
  # ex : [0 0 0 1 0 0 0 0 0 0 0]
  
  W = tf.get_variable('weights', [784,10])
  b = tf.get_vairable('bias', [10])
  y = tf.add(tf.matmul(x,W), b)
  
  cross_entropy = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits_v2(labels=y_,logits=y))
  
  train_step = tf.trin.GradientDescentOptimizer(0.001).minimize(cross_entropy)
  
  correct_pred = tf.equal(tf.argmax(y,1), tf.argmax(y_,1))
  accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32))
  
  sess = tf.Session()
  sess.run(tf.global_variable_initializer())
  
  def feed_dict(is_training):
      if is_training :
          batch_x, batch_y = mnist.train.next_batch(100)
      else:
          batch_x, batch_y = mnist.test.images,mnist.test.labels
      return {x: batch_x, y_: batch_y}
  
  for i in range(100):
      if i % 10 == 0:
          acc = sess.run(accuracy, feed_dict=feed_dict(True))
          print('étape %d: Précision du training:%f' % (i, acc))
      else :
          sess.run([train_step], feed_dict=feed_dict(True))
      
  print('Précision Test: ', sess.run(accuracy,feed_dict=feed_dict(False)))
  </code></pre>