代码之家  ›  专栏  ›  技术社区  ›  MarZzz

无法使用tensorflow AOT编译为CPU后端创建最终二进制文件

  •  1
  • MarZzz  · 技术社区  · 8 年前

    我在这里遵循了教程: TensorFlow AOT compilation

    根据步骤1和2,我编译了子图并生成了头( test_graph_tfmatmul.h )和对象( 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'
    

    欢迎提出任何建议。谢谢

    2 回复  |  直到 8 年前
        1
  •  1
  •   MarZzz    8 年前

    这个问题最终通过使用 tf_library 构建 cc_library 在步骤2中,而不是使用 tfcompile 直接地即。, tf_库 生成头文件和对象文件。

    请参阅 https://github.com/tensorflow/tensorflow/issues/13482

        2
  •  0
  •   hlopko    8 年前

    Bazel抱怨说 tfcompile_test.cc #include "tensorflow/compiler/aot/tests/test_graph_tfmatmul.h" ,但没有提供生成文件中声明的头的依赖关系。你添加了吗 ":test_graph_tfmatmul" 进入deps of my_binary