googlecolab运行时在使用AutoKeras时死亡

2024-05-28 19:59:45 发布

您现在位置:Python中文网/ 问答频道 /正文

每次我试图运行这个从AutoKeras.com网站示例页。在

我的笔记本的链接是: Test Code

代码如下:

from keras.datasets import mnist
from autokeras.image_classifier import ImageClassifier

if __name__ == '__main__':
    (x_train, y_train), (x_test, y_test) = mnist.load_data()
    x_train = x_train.reshape(x_train.shape + (1,))
    x_test = x_test.reshape(x_test.shape + (1,))

    clf = ImageClassifier(verbose=True)
    clf.fit(x_train, y_train, time_limit=12 * 60 * 60)
    clf.final_fit(x_train, y_train, x_test, y_test, retrain=True)
    y = clf.evaluate(x_test, y_test)
    print(y)

代码在运行时一直持续到

^{pr2}$

然后运行时就死了。这与是否包含GPU或运行时仅为CPU无关。在

ETA:在Kaggle上也观察到了同样的行为,即内核在同一点死亡。在


Tags: 代码fromtestimportcomtrue网站train

热门问题