问题
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: I always receive the message
Update I have removed the data sets from Google Drive, but the session is still crashing.
回答1:
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.
回答2:
Just a side note: sometimes you may want to reinstall an litle older version of the related module (see from the error log). It works for me in a case.
来源:https://stackoverflow.com/questions/59703866/google-colab-your-session-crashed-for-an-unknown-reason