Object Detection API error: "ImportError: cannot import name anchor_generator_pb2"
Asked Answered
P

2

7

I'm trying to get Tensorflow's new Object Detection API working. I've followed the installation instructions, but when running the command

python object_detection/builders/model_builder_test.py

I get the following error

from object_detection.protos import anchor_generator_pb2
ImportError: cannot import name anchor_generator_pb2

I've looked inside object_detection.protos, and there doesn't seem to be anything named anchor_generator_pb2. Has anyone else managed to get this command to run, or solved this issue?

Pedestrianize answered 7/7, 2017 at 13:39 Comment(1)
Thanks, finally got this working along with help from https://github.com/tensorflow/models/issues/2930Chip
P
14

Missed a step in the installation instructions, where the following needs to be run from models/research:

protoc object_detection/protos/*.proto --python_out=.

You need to rerun the below command after that:

pip install . 
Pedestrianize answered 7/7, 2017 at 15:2 Comment(1)
After that i had to rerun "pip install ." in research directoryConductivity
S
0

This worked for me Run it from your models/research

python setup.py
protoc -I=./ --python_out=./ ./object_detection/protos/*.proto
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
Silvers answered 16/6, 2022 at 3:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.