我的目标是运行 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/