如何从TensorFlow .pb模型中获取权重格式?
How to get weights format from TensorFlow .pb model?
我想重新组织tensorflow .pb模型的节点,所以我首先从GraphDef获取NodeDef,并使用NodeDef.attr((.为"Conv2D"的节点获取attr。 我可以从 attr 获取步长、填充、data_format、use_cudnn_on_gpu 等参数,但无法获取权重格式参数。 我使用的语言是 c++。 如何获得它!谢谢!
Conv2D
有两个输入:第一个是数据,第二个是filter
(或权重(,因此您只需检查Conv2D
的第二个输入的格式即可。如果您使用的是C++,则可以尝试以下操作:
# Assuming inputs: conv2d_node, node_map.
filter_node_name = conv2d_node.input(1)
filter_node = node_map[filter_node_name]
# You might need to check identity node here.
# Get the shape of filter_node using NodeDef.attr()
相关文章:
- C++为构建时间获取QDateTime的可靠方法
- lambda参数转换为constexpr技巧,然后获取带链接的数组
- 如何使用 < 和 > 命令获取 c++ 中的输入和输出?
- 使用指针从C++中的数组中获取最大值
- 如何获取std::result_of函数的返回类型
- 如何在openssl-ecc中获取十六进制格式的私钥
- 使用Unreal C++获取VR耳机的世界位置/方向
- 获取日期异步信号安全吗?如果在信号处理程序中使用,它会导致死锁吗
- 从C字符串中获取奇怪的字符串长度
- 为什么我的for循环不能正确获取argv
- 从python中调用C++函数并获取返回值
- 如何获取一个数字的前3位
- 获取字符串的长度并将其分配给数组
- 无法获取菜单选择以运行函数.C++
- 数组长度,为什么从命令行获取时不能使用它?
- Boost Spirit,获取迭代器内部语义动作
- 尝试通过OCI例程从Oracle获取blob数据,但出现错误:ORA-01008:并非所有变量都绑定
- BGL 获取图形的权重图
- 如何从TensorFlow .pb模型中获取权重格式?
- 如何从Kruskal MST的捆绑属性中获取权重图