简体   繁体   English

Google Colab中的运行时自动重启错误

[英]runtime automatic restart error in google colab

hi i want to use google colab to train a model for my classification but when i start training after a few seconds, it says 'Runtime died. 您好,我想使用Google colab训练分类模型,但是几秒钟后开始训练时,提示“运行时死亡。 Automatically restarting.' 自动重启。”

my model is: 我的模型是:

model=keras.Sequential([
    keras.layers.Flatten(input_shape=(230, 320, 3)),
    keras.layers.Dense(32,activation=tf.nn.relu),
    keras.layers.Dense(10,activation=tf.nn.relu),
    keras.layers.Dense(5,activation=tf.nn.softmax),
])
opt=tf.train.AdamOptimizer()
model.compile(loss='sparse_categorical_crossentropy',optimizer=opt,metrics=['accuracy'])

and training code is : 培训代码是:

model.fit(train_data,train_labels,epochs=25,validation_split=0.2)

any suggestion? 有什么建议吗?

所以我解决了这个问题,错误是因为我选择了一个图像通道,而当我选择3个通道时,问题就消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM