我知道有一种方法可以检查 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 检查点
发布评论