简体   繁体   English

在预训练的方式Keras,Tensorflow中使用机器学习模型

[英]Use Machine Learning Model in Pretrained Manner Keras, Tensorflow

I built a CNN model for image classification using the Keras library. 我使用Keras库为图像分类建立了CNN模型。 However training takes many hours. 但是培训需要很多小时。 Once I trained my model, how can I use it without training once more? 训练模型后,如何在不进行训练的情况下使用它? I mean after I trained my model, I want to use it many times. 我的意思是说,在训练模型后,我想多次使用它。 Because I will use my model in android studio. 因为我将在android studio中使用我的模型。 Any help is appreciated 任何帮助表示赞赏

Thank YOU... 谢谢...

EDIT 编辑

When I wrote this question, I did not know the save model and load.model, in the answers you see the appropriate usage of them. 当我写这个问题时,我不知道保存模型和load.model,在答案中您看到它们的适当用法。

You can easily save your model after the training process by using: 在训练过程之后,您可以使用以下方法轻松保存模型:

model.save('my_model.h5')

you can later load that model by using: 您以后可以使用以下方式加载该模型:

model = load_model('my_model.h5')

for more details have a look at the documentation: https://keras.io/getting-started/faq/#how-can-i-save-a-keras-model 有关更多详细信息,请参阅文档: https : //keras.io/getting-started/faq/#how-can-i-save-a-keras-model

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

相关问题 TensorFlow、Keras:替换预训练 model 中的激活层 - TensorFlow, Keras: Replace Activation layer in pretrained model Tensorflow:使用预训练的初始模型 - Tensorflow: use pretrained inception model 在Keras-to-TPU模型中使用张量流学习率衰减 - Use tensorflow learning-rate decay in a Keras-to-TPU model 为什么模型没有在keras中使用预训练的vgg16进行学习? - Why is the model not learning with pretrained vgg16 in keras? 在scikit-learn、keras、Z2C39BC19B761AC36DCZ646245D1D4FE和mxnet中保存机器学习model的所有格式是什么? - What are all the formats to save machine learning model in scikit-learn, keras, tensorflow and mxnet? Tensorflow,Keras预训练的MobileNetV2模型未下载 - Tensorflow, Keras pretrained MobileNetV2 Model doesn't download 使用各种损失函数评估预训练的 Tensorflow keras model - Evaluating Pretrained Tensorflow keras model using various loss functions Python 中的 OCR 机器学习 - 使用 keras 训练模型 - OCR Machine Learning in Python -Training model with keras 使用分布式Tensorflow学习Keras模型 - Learning Keras model by using Distributed Tensorflow 自定义迁移学习 model tensorflow-Keras - Customising transfer learning model tensorflow-Keras
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM