简体   繁体   English

如何训练预训练 model (MNIST) tensorflow

[英]How to train pre trained model (MNIST) tensorflow

I have a project with Fashion MNIST, which predicts clothes from uploaded images, and I want to make some improvements with it.我有一个 Fashion MNIST 项目,它根据上传的图像预测衣服,我想用它做一些改进。 Is it possible to modify my project that it will train automatically after each uploaded and prediction?是否可以修改我的项目,使其在每次上传和预测后自动训练?

You can train your model manually by using the transfer learning technique(Transfer learning is a method of reusing an already trained model for another task).您可以使用迁移学习技术手动训练您的 model(迁移学习是一种将已训练的 model 重新用于另一项任务的方法)。

  1. Instantiate a base model and load pre-trained weights into it.实例化一个基础 model 并将预训练的权重加载到其中。
  2. Freeze all layers in the base model by setting trainable = False.通过设置 trainable = False 冻结基础 model 中的所有层。
  3. Create a new model on top of the output of one (or several) layers from the base model. Train your new model on your new dataset.在基础 model 的一个(或多个)层的 output 之上创建一个新的 model。在新数据集上训练新的 model。

Please refer to this gist for working code example.请参阅此要点以获取工作代码示例。 Thank You.谢谢你。

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

相关问题 经过训练的模型上的Tensorflow MNIST分类 - Tensorflow MNIST classification on a trained model 无法在Tensorflow估算器中训练Keras预训练模型 - Cannot Train Keras Pre-trained Model in Tensorflow Estimator 当使用TensorFlow slim调整预训练模型时,如何知道要排除或训练的范围? - How to know which scopes to exclude or to train when fine tuning a pre-trained model with TensorFlow slim? 如何在TensorFlow中使用预训练模型 - How to use pre-trained model in TensorFlow 如何在 tensorflow 中使用预训练的 model 进行预测? - how to predict with pre-trained model in tensorflow? 我们可以使用 tensorflow 用新数据训练预训练模型吗? - Can we train a pre-trained model with new data using tensorflow? 在来自 Keras-Tensorflow 的预训练 model 中仅训练偏差 - Train only bias in a pre-trained model from Keras-Tensorflow Tensorflow如何修改保存为检查点的预训练模型 - Tensorflow how to modify a pre-trained Model saved as checkpoints 如何访问和可视化预训练的 TensorFlow 2 模型中的权重? - How to access and visualize the weights in a pre-trained TensorFlow 2 model? 如何将预训练的张量流模型加载并预测到Java代码中? - How to load and predict a pre-trained tensorflow model into Java code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM