编辑 TensorFlow 检查点 [英] Edit a TensorFlow checkpoint

查看:44
本文介绍了编辑 TensorFlow 检查点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有一种方法可以检查 TF 检查点(如 inspect_checkpoint.py).

I know that there's a way to examine TF checkpoints (such as described in inspect_checkpoint.py).

但是,有没有一种方法可以更新此检查点中的某些权重并将其写回,而无需构建整个模型?比如我想快速编辑其中一层的权重写回,不想写这个模型对应的深度网络的代码.

However, is there a way to update certain weights in this checkpoint and write it back, without having to construct the whole model? For example, I want to quickly edit the weights of one of the layers and write it back, and don't want to write the code for the deep network this model corresponds to.

推荐答案

看一看 MetaGraph 保存和加载.那里有几个例子;您应该能够定义模型、保存 MetaGraph,然后加载和修改它,而无需手动重新定义变量.

Take a look at MetaGraph saving and loading. There are a few examples there; you should be able to define the model, save the MetaGraph, then load and modify it without re-defining the variables manually.

这篇关于编辑 TensorFlow 检查点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆