Bazel 没有 py_proto_library 的定义
Bazel has no definition for py_proto_library
我在尝试 运行
时遇到以下错误
$ bazel build object_detection/...
而且我遇到了大约 20 个相同的错误(每次尝试构建时都会出现 1 个错误)。我认为这与我需要配置 bazel 以识别 py_proto_library 的方式有关,但我不知道在哪里或如何执行此操作。
/src/github.com/tensorflow/tensorflow_models/object_detection/protos/BUILD:325:1: name 'py_proto_library' is not defined (did you mean 'cc_proto_library'?).
我也认为这可能是一个问题,因为最初我安装了 cpp 版本的 tensorflow,然后我为 python 构建了它。
您是否在正在构建的 BUILD
文件中使用 load
?
load("@protobuf//:protobuf.bzl", "py_proto_library")
?
该错误似乎表明符号 py_proto_library
未加载到 skylark。
最终的解决方案是 运行 这个命令,就像说明中说的那样:
$ protoc object_detection/protos/*.proto --python_out=.
然后运行这个命令,就像指令说的那样。:
$ export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
我在尝试 运行
时遇到以下错误$ bazel build object_detection/...
而且我遇到了大约 20 个相同的错误(每次尝试构建时都会出现 1 个错误)。我认为这与我需要配置 bazel 以识别 py_proto_library 的方式有关,但我不知道在哪里或如何执行此操作。
/src/github.com/tensorflow/tensorflow_models/object_detection/protos/BUILD:325:1: name 'py_proto_library' is not defined (did you mean 'cc_proto_library'?).
我也认为这可能是一个问题,因为最初我安装了 cpp 版本的 tensorflow,然后我为 python 构建了它。
您是否在正在构建的 BUILD
文件中使用 load
?
load("@protobuf//:protobuf.bzl", "py_proto_library")
?
该错误似乎表明符号 py_proto_library
未加载到 skylark。
最终的解决方案是 运行 这个命令,就像说明中说的那样:
$ protoc object_detection/protos/*.proto --python_out=.
然后运行这个命令,就像指令说的那样。:
$ export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim