# Cannot import name 'anchor\_generator\_pb2' from 'object\_detection.protos'

**URL:** <https://discuss.ai.google.dev/t/cannot-import-name-anchor-generator-pb2-from-object-detection-protos/25264>\
**Category:** General Discussion\
**Tags:** help\_request\
**Created:** [July 13, 2022, 1:01pm UTC](https://discuss.ai.google.dev/t/cannot-import-name-anchor-generator-pb2-from-object-detection-protos/25264 "2022-07-13T13:01:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![N048](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/n048/32/13309_2.png) [@N048](https://discuss.ai.google.dev/u/N048)\
**Post date:** [July 13, 2022, 1:01pm UTC](https://discuss.ai.google.dev/t/cannot-import-name-anchor-generator-pb2-from-object-detection-protos/25264/1 "2022-07-13T13:01:49Z")

</div>

When running a verification script, this error outputs: `cannot import name 'anchor_generator_pb2' from 'object_detection.protos'`.  
I have been stuck at this error for a long time, but I haven’t been able to solve it.  
Any help is greatly appreciated!  
Thank you

---

<div class="post-metadata">

**Author:** ![Bhack](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/bhack/32/6388_2.png) [@Bhack](https://discuss.ai.google.dev/u/Bhack)\
**Post date:** [July 13, 2022, 3:25pm UTC](https://discuss.ai.google.dev/t/cannot-import-name-anchor-generator-pb2-from-object-detection-protos/25264/3 "2022-07-13T15:25:14Z")

</div>

Have you checked?

> <https://stackoverflow.com/questions/44972277/object-detection-api-error-importerror-cannot-import-name-anchor-generator-pb>

---

<div class="post-metadata">

**Author:** ![N048](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/n048/32/13309_2.png) [@N048](https://discuss.ai.google.dev/u/N048)\
**Post date:** [July 13, 2022, 5:13pm UTC](https://discuss.ai.google.dev/t/cannot-import-name-anchor-generator-pb2-from-object-detection-protos/25264/4 "2022-07-13T17:13:08Z")

</div>

Yes, that didn’t work.

---

<div class="post-metadata">

**Author:** ![Bhack](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/bhack/32/6388_2.png) [@Bhack](https://discuss.ai.google.dev/u/Bhack)\
**Post date:** [July 13, 2022, 5:47pm UTC](https://discuss.ai.google.dev/t/cannot-import-name-anchor-generator-pb2-from-object-detection-protos/25264/5 "2022-07-13T17:47:16Z")

</div>

Have you also looked at the mentioned fullthread?

> <https://github.com/tensorflow/models/issues/2930>
>
> As mentioned above the error takes place in while executing the command in the w…indows cmd prompt.
> 
> \>D:/BB/bin/protoc object\_detection/protos/\*.proto --python\_out=.
> 
> as for the reference in the installation process of object detection in this model.
> 
> in protobuf compilation.

---

<div class="post-metadata">

**Author:** ![N048](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/n048/32/13309_2.png) [@N048](https://discuss.ai.google.dev/u/N048)\
**Post date:** [July 14, 2022, 4:23am UTC](https://discuss.ai.google.dev/t/cannot-import-name-anchor-generator-pb2-from-object-detection-protos/25264/6 "2022-07-14T04:23:55Z")

</div>

Yup, that didn’t resolve it either.

---

<div class="post-metadata">

**Author:** ![Bhack](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/bhack/32/6388_2.png) [@Bhack](https://discuss.ai.google.dev/u/Bhack)\
**Post date:** [July 14, 2022, 9:11am UTC](https://discuss.ai.google.dev/t/cannot-import-name-anchor-generator-pb2-from-object-detection-protos/25264/8 "2022-07-14T09:11:53Z")

</div>

As you have already a ticket I suppose you could track your issue there:

> <https://github.com/tensorflow/tensorflow/issues/56756#issuecomment-1184025464>
>
> When running a verification script this error outputs: ImportError: cannot impor…t name 'anchor\_generator\_pb2' from 'object\_detection.protos'
> I have been stuck at this error for many days and all the solutions haven't worked.
> Any help is greatly appreciated.
