简单来说,在处理模型时(不仅仅是在Keras中),通常有四个主要步骤: 构建模型并编译:model.compile() 使用训练数据训练模型:model.fit() 使用测试数据评估模型:model.evaluate() 使用目标数据进行预测:model.predict() 根据您需要的输出,您将不得不使用model.predict_proba()或model.predict_classes()。请参阅https://keras.io/models/sequential/#sequential-model-methods获取完整的参考和参数。Keras存储库还有很多示例:https://github.com/fchollet/keras/tree/master/examples