title: Google Colab Upload error, how can you fix it? (Cannot read property '_uploadFiles' of undefined)
body: <p>my problem is that I always get the following error when I operate the following code.Strange thing is that, when i set the epochs to 0 the error dosnt show up and I can upload with no problems. Thanks for the Help!</p>
  
  <p>I have already tried anabling third party cockies, which did not help. The strange thing is, that the upload works, if I set the training epochs to 0.
  Sometimes the error is google.colab._files is undefined.</p>
  
  <p>I have already tried to use Chrome and Firefox.</p>
  
  <pre><code>import tensorflow as tf 
  import numpy as np
  
  mnist = tf.keras.datasets.fashion_mnist
  (training_images, training_labels), (test_images, test_labels) = mnist.load_data()
  
  training_images = training_images.reshape(60000, 28, 28, 1)
  training_images = training_images / 255.0
  test_images = test_images.reshape(10000, 28, 28, 1)
  test_images = test_images / 255.0
  model = tf.keras.models.Sequential([
  tf.keras.layers.Conv2D(32,(3,3),activation='relu', input_shape=(28,28,1)),
  tf.keras.layers.MaxPooling2D(2,2),
  tf.keras.layers.Conv2D(64,(3,3),activation='relu'),
  tf.keras.layers.Flatten(),
  tf.keras.layers.Dense(128, activation='relu'),
  tf.keras.layers.Dense(10, activation='softmax')
  </code></pre>
  
  <p>])</p>
  
  <pre><code>model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
  model.fit(training_images,training_labels, epochs=1)
  classes = model.predict(test_images)
  predicted_classes = np.argmax(classes, axis=1)
  print(classes[0])
  print(test_labels[0])
  
  mnist = tf.keras.datasets.fashion_mnist
  
  (training_images, training_labels), (test_images, test_labels) = mnist.load_data()
  
  import matplotlib.pyplot as plt
  
  plt.imshow(test_images[0], cmap='Greys_r')
  import numpy as np
  from google.colab import files
  from keras.preprocessing import image
  import cv2
  import matplotlib.pyplot as plt
  
  uploaded = files.upload()
  
  for fn in uploaded.keys(): 
    path = '/content/' + fn
    img = cv2.imread(path) 
  
  img = cv2.resize(img,(28,28))
  img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
  x = image.img_to_array(img, dtype=np.float32)
  print("top left pixel value:", x[0,0])
  if x[0,0] &gt; 250:
  # white background
  print("needs to be inverted!")
  x -= 255
  x *= -1
  x = x / 255.0
  x = x.reshape(1, 28, 28, 1)
  plt.imshow(img, cmap='Greys_r')
  plt.show()  
  
  
  classes = model.predict(x)
  plt.bar(range(10), classes[0])
  plt.show()
  print("prediction: class", np.argmax(classes[0]))
  </code></pre>
  
  <p>TypeError: Cannot read property '_uploadFiles' of undefined</p>