1

我在这里按照教程进行操作:TensorFlow AOT 编译

根据步骤1和2,我编译了subgraph,生成了header( test_graph_tfmatmul.h)和object( test_graph_tfmatmul.o)文件;

根据步骤 3,我使用示例代码(命名为my_code.cc)来调用子图;

根据第 4 步,我将代码片段添加cc_binary到现有BUILD文件 ( //tensorflow/compiler/aot/tests/BUILD),并尝试使用以下命令创建最终二进制文件:

bazel build //tensorflow/compiler/aot/tests:my_binary

但我收到以下错误:

undeclared inclusion(s) in rule '//tensorflow/compiler/aot/tests:my_binary':
this rule is missing dependency declarations for the following files included by 'tensorflow/compiler/aot/tests/tfcompile_test.cc':
'/home/tensorFlow_src/tensorflow/tensorflow/compiler/aot/tests/test_graph_tfmatmul.h'

欢迎任何建议。谢谢。

4

2 回答 2

1

这个问题最终通过第2步中的使用tf_library来构建,而不是直接使用来解决。即,将运行以生成头文件和目标文件。cc_librarytfcompiletf_librarytfcompile

更多详细信息请参考https://github.com/tensorflow/tensorflow/issues/13482

于 2017-10-12T00:19:41.847 回答
0

Bazel 抱怨在tfcompile_test.ccyou#include "tensorflow/compiler/aot/tests/test_graph_tfmatmul.h"中,但没有提供在 BUILD 文件中声明的头文件的依赖项。您是否添加":test_graph_tfmatmul"到 deps 中my_binary

于 2017-10-09T17:25:31.287 回答