我尝试使用tensorflow训练自己的对象检测,但是我得到以下错误

时间:2018-02-20 21:29:19

标签: python ubuntu tensorflow neural-network object-detection

我试图在张量流中对自己的图像进行分类。 我已输入以下命令来训练我的模型:

python3 train.py --logstderr --train_dir=training/ --
pipeline_config_path=training/ssd_mobilenet_v1_pets.config

从教程https://youtu.be/JR8CmWyh2E8?t=757时间12:38

我收到以下错误:

Traceback (most recent call last):
  File "train.py", line 51, in <module>
    from object_detection.builders import model_builder
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "/usr/local/lib/python3.5/dist-packages/object_detection-0.1-py3.5.egg/object_detection/builders/model_builder.py", line 17, in <module>
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "/usr/local/lib/python3.5/dist-packages/object_detection-0.1-py3.5.egg/object_detection/builders/anchor_generator_builder.py", line 20, in <module>
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "/usr/local/lib/python3.5/dist-packages/object_detection-0.1-py3.5.egg/object_detection/protos/anchor_generator_pb2.py", line 27, in <module>
  File "/usr/local/lib/python3.5/dist-packages/google/protobuf/descriptor.py", line 829, in _new_
    return _message.default_pool.AddSerializedFile(serialized_pb)
TypeError: Couldn't build proto file into descriptor pool!
Invalid proto descriptor for file "object_detection/protos/anchor_generator.proto":
  object_detection/protos/anchor_generator.proto: Import "object_detection/protos/grid_anchor_generator.proto" has not been loaded.
  object_detection/protos/anchor_generator.proto: Import "object_detection/protos/ssd_anchor_generator.proto" has not been loaded.
  object_detection.protos.AnchorGenerator.grid_anchor_generator: "object_detection.protos.GridAnchorGenerator" seems to be defined in "protos/grid_anchor_generator.proto", which is not imported by "object_detection/protos/anchor_generator.proto".  To use it here, please add the necessary import.
  object_detection.protos.AnchorGenerator.ssd_anchor_generator: "object_detection.protos.SsdAnchorGenerator" seems to be defined in "protos/ssd_anchor_generator.proto", which is not imported by "object_detection/protos/anchor_generator.proto".  To use it here, please add the necessary import.

我做错了什么?提前谢谢。

更新:

我现在收到此错误:

Traceback (most recent call last):
  File "train.py", line 51, in <module>
    from object_detection.builders import model_builder
  File "/usr/local/lib/python3.5/dist-packages/object_detection-0.1-py3.5.egg/object_detection/builders/model_builder.py", line 17, in <module>
  File "/usr/local/lib/python3.5/dist-packages/object_detection-0.1-py3.5.egg/object_detection/builders/anchor_generator_builder.py", line 20, in <module>
ImportError: cannot import name 'anchor_generator_pb2'

0 个答案:

没有答案