我正在尝试按照本页提供的示例使用来自 Tensorflow 的XLA 编译器:
https://gist.github.com/carlthome/6ae8a570e21069c60708017e3f96c9fd
简而言之,它会下载一个 ResNet50 网络并将其编译为库。
在执行 bazel build 期间,我总是会遇到以下构建错误:
错误:找不到包含文件“tensorflow/compiler/mlir/xla/ir/hlo_ops_base.td”包括“tensorflow/compiler/mlir/xla/ir/hlo_ops_base.td”^ external/org_tensorflow/tensorflow/compiler/mlir/xla /ir/hlo_ops.td:22:9:错误:顶层的意外输入包括“tensorflow/compiler/mlir/xla/ir/hlo_ops_base.td”
> ERROR: /home/ubuntu/.cache/bazel/_bazel_ubuntu/e5cce820cc082410b4fcc604db349066/external/org_tensorflow/tensorflow/compiler/mlir/xla/BUILD:465:1: Executing genrule @org_tensorflow//tensorflow/compiler/mlir/xla:operator_writer_inc failed (Exit 1)
[6,144 / 7,191] 3 actions running
@org_tensorflow//tensorflow/compiler/xla/client:global_data; 4s local
@org_tensorflow//tensorflow/core/kernels/tensor_forest:resources; 1s local
...//tensorflow/core/kernels:eigen_contraction_kernel_with_mkl; 1s local
external/org_tensorflow/tensorflow/compiler/mlir/xla/ir/hlo_ops.td:22:9: error: Could not find include file 'tensorflow/compiler/mlir/xla/ir/hlo_ops_base.td'
include "tensorflow/compiler/mlir/xla/ir/hlo_ops_base.td"
^
external/org_tensorflow/tensorflow/compiler/mlir/xla/ir/hlo_ops.td:22:9: error: Unexpected input at top level
include "tensorflow/compiler/mlir/xla/ir/hlo_ops_base.td"
^
[6,144 / 7,191] 3 actions running
@org_tensorflow//tensorflow/compiler/xla/client:global_data; 4s local
@org_tensorflow//tensorflow/core/kernels/tensor_forest:resources; 1s local
...//tensorflow/core/kernels:eigen_contraction_kernel_with_mkl; 1s local
Target @org_tensorflow//:graph failed to build
[6,147 / 7,191] checking cached actions
Use --verbose_failures to see the command lines of failed build steps.
[6,147 / 7,191] checking cached actions
INFO: Elapsed time: 7903.567s, Critical Path: 204.12s
[6,147 / 7,191] checking cached actions
INFO: 5961 processes: 5961 local.
[6,147 / 7,191] checking cached actions
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
所以,它没有找到路径中当然存在的hlo_ops_base.td文件(我检查了它)
我第一次尝试这个,它就像一个魅力。
之后我在不同的机器上再次执行它(也在不同平台上完美干净的虚拟机),但总是遇到同样的问题。
我在用
- 巴泽尔 1.1.0 ,
- 张量流 1.14 (cpu) ,
- protobuf 3.0.0 ,
- 蟒蛇2.7
有没有人知道如何解决这个问题?我已经尝试在网上搜索它,似乎没有其他人遇到这个问题......
谢谢, 马特奥