python - 无法导入名称 'string_int_label_map_pb2'

标签 python tensorflow protocol-buffers

我的目标是运行 tensorflow 对象检测 API 并按照安装步骤进行操作。

我安装了 tensorflow 对象检测 API 和 protobuf。
我还添加了 protobuf 的路径。
但是会出现以下错误:

ImportError: cannot import name 'string_int_label_map_pb2'

安装的 protobuf :
%%bash
cd models/research
protoc object_detection/protos/*.proto --python_out=.

包含错误导入语句的代码块:
from object_detection.utils import ops as utils_ops
from object_detection.utils import label_map_util
from object_detection.utils import visualization_utils as vis_util

最佳答案

从安装 protoc-3.11.4
https://github.com/google/protobuf/releases
并运行 protoc object_detection/protos/*.proto --python_out=.installation instructions 中所述.并把 this在对象检测/原型(prototype)中归档

关于python - 无法导入名称 'string_int_label_map_pb2',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60600529/

相关文章:

python - Keras对层数的困惑

go - 如何在 gRPC Protobuf 中创建接口(interface)类型?

c# - protobuf-csharp-端口

python - 使用 Python (mpi4py) 在 Google Cloud Engine 上进行分布式编程

python - 在 tastypie 中发布 url

python - 为什么在 Keras 中 Adam.iterations 总是设置为 0?

go - ProtoMessage 方法的目的是什么?

python - 如何按字母顺序对大型文本文件进行排序?

带有 format() 的 Python 默认参数

python - 导入错误:无法导入名称 normalize_data_format