首页 > 解决方案 > 如何解决错误“无法从'object_detection.protos'导入名称'string_int_label_map_pb2'”

问题描述

我和我的朋友们正在参加一个黑客马拉松,并且被困在这个关于训练对象检测模型的教程中:

https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html

但是在三个人尝试按照上面的教程写信之后,我们都卡在了创建 TfRecord 的步骤上:

https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html#create-tensorflow-records

我们收到错误消息:

ImportError:无法从“object_detection.protos”导入名称“string_int_label_map_pb2”

我们是三个不同的人,拥有三台不同的机器,得到了这个结果,并且总共花费了 20 多个小时的谷歌搜索、重试、向可怕的神献祭,没有任何东西能让我们通过这个障碍。

是否有更好的方法来实现结果或解决问题?我们对 Tensorflow 缺乏经验,只是想用它来训练一个模型,该模型可以转换为将由 ml.net 使用的 onnx 模型。

标签: pythontensorflowobject-detectionml.netonnx

解决方案


感谢@EdwinCheong为我们指明了正确的方向。

在遵循此链接教程之前,基本上通过在 Visual Studio 安装程序中下载 Windows 10 SDK 和一堆与 c++ 相关的包来解决该问题: https ://tensorflow-object-detection-api-tutorial.readthedocs.io/en/ latest/install.html#tf-models-install与安装对象检测相关。无论教程说什么,似乎都需要 CUDA


推荐阅读