首页 > 解决方案 > 变换图。您必须使用 dtype float 和 shape 为占位符张量“image”提供一个值

问题描述

我正在尝试在冻结之前优化图形。

quant_graph_def = TransformGraph(input_graph_def=graph_def,
                                     inputs=input_names_,
                                     outputs=output_names_,
                                     transforms=["quantize_nodes"])

因此,在使用 InteractiveSession 推断之后 - 我看到了消息:

您必须使用 dtype float 和 shape [?,?,?,6] [[{{node import/image}}]] 为占位符张量“import/image”提供一个值

但是没有 quantize_nodes - 没问题。TransformGraph 函数的 TensorFlow 版本是 1.10。并且推断 tensorflow 是 2.x。

标签: pythontensorflowneural-network

解决方案


推荐阅读