Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在模型拟合后获取变量(例如,嵌入表、RNN 变量等),当使用 TensorFlowEstimator 进行拟合时,例如在这个skflow 示例中?由于 tf.all_variables() 返回空列表。
您可以get_variable_names()在估算器中使用。
get_variable_names()
基本上,您需要获取图表,然后调用all_variables(). 例如: with self._graph.as_default(): print([v.name for v in variables.all_variables()])
all_variables()
with self._graph.as_default(): print([v.name for v in variables.all_variables()])