使用 bazel 构建时“没有这样的包‘@bazel_tools//platforms’”

问题描述 投票:0回答:1

我正在尝试在 variscite 板(aarch64 cpu)上运行一些示例机器学习项目。他们需要 libcoral,而 libcoral 本身是用 Bazel 构建的。

我已使用此处的从头开始构建指南,在该环境中成功构建了 Bazel,现在正在尝试按照此处的说明构建 libcoral。但是,我收到以下错误:

make CPU=aarch64
Loading: 0 packages loaded
bazel build --compilation_mode=opt --cpu=aarch64 --copt=-ffp-contract=off //coral:bbox_test //coral:error_reporter_test //coral:inference_repeatability_test //coral:inference_stress_test //coral:model_loading_stress_test //coral:multiple_tpus_inference_stress_test //coral:segmentation_models_test //coral:test_utils_test //coral:tflite_utils_test //coral/classification:adapter_test //coral/classification:classification_models_test //coral/classification:cocompiled_classification_models_test //coral/classification:lstm_mnist_models_test //coral/detection:adapter_test //coral/detection:models_test //coral/dmabuf:dmabuf_devboard_test //coral/dmabuf:model_pipelining_dmabuf_devboard_test //coral/learn:imprinting_engine_test //coral/learn:utils_test //coral/learn/backprop:layers_test //coral/learn/backprop:multi_variate_normal_distribution_test //coral/learn/backprop:softmax_regression_model_test //coral/learn/backprop:test_utils_test //coral/pipeline:detection_models_test //coral/pipeline:models_test //coral/pipeline:pipelined_model_runner_test //coral/pipeline/internal:memory_pool_allocator_test //coral/pipeline/internal:segment_runner_test //coral/pose_estimation:bodypix_test //coral/pose_estimation:movenet_test //coral/pose_estimation:posenet_decoder_test //coral/pose_estimation:posenet_test //coral/tools:automl_model_append_rnn_link_test //coral/tools:tflite_graph_util_test //coral/tools/partitioner:parameter_count_based_partitioner_test //coral/tools/partitioner:profiling_based_partitioner_ondevice_test //coral/tools/partitioner:profiling_based_partitioner_test //coral/tools/partitioner:utils_test
ERROR: no such package '@bazel_tools//platforms': BUILD file not found in directory 'platforms' of external repository @bazel_tools. Add a BUILD file to a directory to mark it as a package.

我认为这意味着 Bazel 没有正确安装。然而,仅仅重新编译它会导致同样的问题。我也没有在网上发现任何人遇到这样的问题,并且仔细检查兼容性让我相信这也不是问题......知道可能导致此问题的原因吗?

build bazel arm64 google-coral
1个回答
0
投票

Bazel 7.0 中删除了

@bazel_tools//platforms/...
下的平台,取而代之的是单独的平台存储库。参见:

https://github.com/bazelbuild/bazel/issues/8622

看起来这个例子需要更新。您也许可以使用上一期中的迁移提示在本地更新示例。

© www.soinside.com 2019 - 2024. All rights reserved.