具有MNIST数据的Autokeras失败

时间:2019-01-09 16:41:46

标签: machine-learning keras conv-neural-network mnist auto-keras

当我从网站(https://autokeras.com/start/)运行MNIST示例时:

from keras.datasets import mnist
from autokeras.image.image_supervised 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)

超时后会出现以下错误:

  

文件“ C:\ Program Files \ Python36 \ lib \ site-packages \ sklearn \ metrics \ classification.py”,   1568行,在         name_width = max(len(cn)for target_names中的cn)       TypeError:类型为'numpy.uint8'的对象没有len()

当我运行MNIST数据的一个子集(20列火车/ 200次测试)时,超时后会出现以下错误:

  

文件“ C:\ Program   Files \ Python36 \ lib \ site-packages \ autokeras \ preprocessor.py“,第50行,   作为回报np.array(list(map(lambda x:self.label_to_vec [x],   数据)))        KeyError:7

0 个答案:

没有答案