在Tensorflow中的transform_graph中使用strip_unused_nodes时出错

时间:2018-09-18 06:18:03

标签: python tensorflow

我正在使用以下代码优化冻结的Tensorflow模型:

## From /tensorflow root directory
bazel-bin/tensorflow/tools/graph_transforms/transform_graph \
--in_graph=/Users/cvsanbuenaventura/Documents/tensorflols/research/object_detection/inference_graph/frozen_inference_graph.pb \ 
--out_graph=/Users/cvsanbuenaventura/Documents/tensorflow_fastlog/models/research/object_detection/inference_graph/optimized_inference_graph.pb \
--inputs='image_tensor' \
--outputs='detection_boxes, detection_scores, detection_classes, num_detections' \
--transforms='fold_batch_norms
fold_old_batch_norms
strip_unused_nodes(type=float, shape="None,None,None,3")'

当我排除strip_unused_nodes并能够从网络摄像头feed中测试对象检测模型时,没有错误。但是,当我包含strip_unused_nodes时,它给了我这个错误:

  

E tensorflow / tools / graph_transforms / transform_graph.cc:263]输入节点   在图E中找不到detection_scores   tensorflow / tools / graph_transforms / transform_graph.cc:264]用法:   bazel-bin / tensorflow / tools / graph_transforms / transform_graph

如何解决这个问题?

当我使用汇总图时,输出为:

  

找到1个可能的输入:(name = image_tensor,type = uint8(4),   shape = [?,?,?,3])没有发现变量。找到了4个可能的输出:   (name = detection_boxes,op = Identity)(name = detection_scores,   op = Identity)(名称= detection_classes,op = Identity)   (名称= num_detections,op =身份)

0 个答案:

没有答案