TensorFlow:量化错误“目标'//tensorflow/tools/graph_transforms:transform_graph分析"失败;构建中止." [英] TensorFlow: Quantization Error "Analysis of target '//tensorflow/tools/graph_transforms:transform_graph' failed; build aborted."
问题描述
我正在对我现有的初始模型图进行量化,以尝试将其大小从〜89mb减小到30mb左右,这根据Google教程
I am working to quantize my existing inception model graph in an attempt to reduce its size from ~89mb so something around 30mb as claimed according to the google tutorial here. The issue I am having is when I try to copy the following code snippet into mac OS terminal I get the following error.
代码段我尝试复制并运行:
Code Snippet I try to copy and run:
bazel build tensorflow/tools/graph_transforms:transform_graph
bazel-bin/tensorflow/tools/graph_transforms/transform_graph \
--in_graph=/tmp/classify_image_graph_def.pb \
--outputs="softmax" --out_graph=/tmp/quantized_graph.pb \
--transforms='add_default_attributes strip_unused_nodes(type=float, shape="1,299,299,3")
remove_nodes(op=Identity, op=CheckNumerics) fold_constants(ignore_errors=true)
fold_batch_norms fold_old_batch_norms quantize_weights quantize_nodes
strip_unused_nodes sort_by_execution_order'
我得到的错误的屏幕截图:
A screenshot of the error I get:
如果您不想打开图像,该错误基本上会说明以下内容:
The error essentially says the following in case you don't want to open the image:
ERROR: /Users/vivek/Desktop/commit2/tensorflow-master/tensorflow/core/BUILD:1546:1: no such target '//tensorflow/tools/git:gen/spec.json': target 'gen/spec.json' not declared in package 'tensorflow/tools/git' defined by /Users/vivek/Desktop/commit2/tensorflow-master/tensorflow/tools/git/BUILD and referenced by '//tensorflow/core:version_info_gen'.
ERROR: /Users/vivek/Desktop/commit2/tensorflow-master/tensorflow/core/BUILD:1546:1: no such target '//tensorflow/tools/git:gen/head': target 'gen/head' not declared in package 'tensorflow/tools/git' defined by /Users/vivek/Desktop/commit2/tensorflow-master/tensorflow/tools/git/BUILD and referenced by '//tensorflow/core:version_info_gen'.
ERROR: /Users/vivek/Desktop/commit2/tensorflow-master/tensorflow/core/BUILD:1546:1: no such target '//tensorflow/tools/git:gen/branch_ref': target 'gen/branch_ref' not declared in package 'tensorflow/tools/git' defined by /Users/vivek/Desktop/commit2/tensorflow-master/tensorflow/tools/git/BUILD and referenced by '//tensorflow/core:version_info_gen'.
ERROR: Analysis of target '//tensorflow/tools/graph_transforms:transform_graph' failed; build aborted.
INFO: Elapsed time: 28.452s
关于为什么发生这种情况以及如何解决此问题的任何想法?
Any ideas as to why this is happening and how I can go about troubleshooting this?
推荐答案
您似乎没有配置tensorflow回购.您需要在顶层tensorflow目录中的./configure
并回答它提出的所有问题,然后才能在其中构建任何内容(包括transform_graph工具).
It looks like you did not configure the tensorflow repo. You need to ./configure
in the top level tensorflow directory and answer all the questions it asks before you can build anything in it (including transform_graph tool).
有关更多信息,请参见 https://www.tensorflow.org中的配置安装"部分/install/install_sources
For more info, see section "Configure the installation" in https://www.tensorflow.org/install/install_sources
这篇关于TensorFlow:量化错误“目标'//tensorflow/tools/graph_transforms:transform_graph分析"失败;构建中止."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!