Tensorflow 部分恢复模型
来源:互联网 发布:信捷plc xc3编程软件 编辑:程序博客网 时间:2024/04/30 14:10
It is often desirable to fine-tune a pre-trained model on an entirely new dataset or even a new task. In these situations, one can use TF-Slim’s helper functions to select a subset of variables to restore:
# Create some variables.v1 = slim.variable(name="v1", ...)v2 = slim.variable(name="nested/v2", ...)...# Get list of variables to restore (which contains only 'v2'). These are all# equivalent methods:variables_to_restore = slim.get_variables_by_name("v2")# orvariables_to_restore = slim.get_variables_by_suffix("2")# orvariables_to_restore = slim.get_variables(scope="nested")# orvariables_to_restore = slim.get_variables_to_restore(include=["nested"])# or# 举个例子 vgg/conv6 vgg 都可以作为exclude的参数传入variables_to_restore = slim.get_variables_to_restore(exclude=["v1"])# Create the saver which will be used to restore the variables.restorer = tf.train.Saver(variables_to_restore)with tf.Session() as sess: # Restore variables from disk. restorer.restore(sess, "/tmp/model.ckpt") print("Model restored.") # Do some work with the model ...
阅读全文
0 0
- Tensorflow 部分恢复模型
- Tensorflow:模型保存/模型恢复?
- tensorflow之inception_v3模型的部分加载及权重的部分恢复(23)---《深度学习》
- TensorFlow之保存/恢复模型
- Tensorflow:如何保存/恢复模型?
- 【深度学习】Tensorflow模型保存与恢复
- Tensorflow模型持久化与恢复
- tensorflow中模型的保存和恢复
- tensorflow 模型的保存与恢复(Saver)
- tensorflow中保存部分模型节点
- tensorflow 中导出/恢复模型Graph数据Saver
- TensorFlow 笔记(五):模型保存和恢复
- TensorFlow 训练好模型参数的保存和恢复代码
- TensorFlow学习--模型的存储与恢复
- 简单完整地讲解tensorflow模型的保存和恢复
- 16、TensorFLow 模型参数的保存与恢复
- tensorflow训练模型保存saver和恢复restore
- tensorflow 1.0 学习:模型的保存与恢复(Saver)
- Java五子棋控制台小程序
- 如何通过一台电脑黑掉一个国家?
- 大数据学习笔记-(一)准备
- 各个击破搞明白PorterDuff.Mode
- Android手机显示的4G信号强度的格子数
- Tensorflow 部分恢复模型
- 特征点检测:FAST and SIFT
- 从零学习php开发wtblog 视频教程,共8课!
- 【Alogrithm】bfs dfs 分别求最短路径的种类数
- node 通过指令创建一个package.json文件及npm安装package.json
- Laravel框架学习(数据库高级查询)
- 2017男宝宝起名大全来了,快来给你的孩子挑个好名字吧
- 生成自签名SSL证书
- 超大规模的数据中心市场的优势