如何读取保存在 tensorflow 检查点文件中的权重? [英] How to read weights saved in tensorflow checkpoint file?

查看:43
本文介绍了如何读取保存在 tensorflow 检查点文件中的权重?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想读取权重并将它们可视化为图像.但我没有看到任何关于模型格式以及如何读取训练权重的文档.

解决方案

There's this utility which has on print_tensors_in_checkpoint_file method http://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/tools/inspect_checkpoint.py>

或者,您可以使用 Saver 来恢复模型并在变量张量上使用 session.run 以获取 numpy 数组形式的值

I'd like to read the weights and visualize them as images. But I don't see any documentation about model format and how to read the trained weights.

解决方案

There's this utility which has on print_tensors_in_checkpoint_file method http://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/tools/inspect_checkpoint.py

Alternatively, you can use Saver to restore the model and use session.run on variable tensors to get values as numpy arrays

这篇关于如何读取保存在 tensorflow 检查点文件中的权重?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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