python - 冻结模型中的 KeyError
问题描述
我已经使用 TensorFlow 的graph_util.convert_variables_to_constants
功能来冻结ckpt
模型。我已将ckpt
模型中的所有节点添加到convert_variables_to_constants
.
但是,当我想加载冻结的模型并使用它时,显然没有添加一些节点。我的意思是在下面一行:
logits = tf.get_default_graph().get_tensor_by_name("Logits/BiasAdd:0")
它给了我以下错误:
KeyError: "The name 'Logits/BiasAdd:0' refers to a Tensor which does not exist. The operation, 'Logits/BiasAdd', does not exist in the graph."
任何想法如何将此节点添加到冻结模型中?
解决方案
推荐阅读
- mysql - mysql:是否可以忽略冷备份中的某些表?
- vue.js - 为 vue 路由设置全局默认组件
- javascript - 更改数组中的特定值且数组为空
- css - Angular 中的两个主题。SCSS中的变量问题
- node.js - google-cloud 客户端库密钥文件为 json
- vue.js - 如何通过加载器 prependData 向 Nuxt 中的所有 scss 文件添加多变量
- c - 在C中满足要求时如何退出循环
- reactjs - 如何在 Electron React 中使用标准菜单更改路线
- jquery - 引导手风琴在第一次加载时不会崩溃
- javascript - 在模态框内渲染表单 - django