Google Colab – Your session crashed for an unknown reason

Issue

Your session crashed for an unknown reason

when I run the following cell in Google Colab:

from keras import backend as K
if 'tensorflow' == K.backend():
  import tensorflow as tf
  from keras.backend.tensorflow_backend import set_session
  config = tf.ConfigProto()
  config.gpu_options.allow_growth = True
  config.gpu_options.visible_device_list = "0"
  set_session(tf.Session(config=config))

I receive this message since I have uploaded two data sets to google drive.

Does anyone know this message and can give me some advice?
Many thanks for every hint.

Update:
enter image description hereI always receive the message

Update
I have removed the data sets from Google Drive, but the session is still crashing.

Solution

Google Colab is crashing because you are trying to Run Code related to GPU with Runtime as CPU.

The execution is successful if you change the Runtime as GPU. Steps for the same are mentioned below:

Runtime -> Change Runtime -> GPU (Select from dropdown).

Please find the Working code in Github Gist.

Answered By – Tensorflow Support

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published