ImportError: cannot import name 'builder' from 'google.protobuf.internal'

When i tested the file

python object_detection/builders/

, i encountered the following error.

Traceback (most recent call last):
  File "C:\Users\yunpeng\models\research\object_detection\builders\", line 24, in <module>
    from import model_builder
  File "C:\Users\yunpeng\anaconda3\envs\tf2\lib\site-packages\object_detection\builders\", line 23, in <module>
    from import anchor_generator_builder
  File "C:\Users\yunpeng\anaconda3\envs\tf2\lib\site-packages\object_detection\builders\", line 26, in <module>
    from object_detection.protos import anchor_generator_pb2
  File "C:\Users\yunpeng\anaconda3\envs\tf2\lib\site-packages\object_detection\protos\", line 5, in <module>
    from google.protobuf.internal import builder as _builder
ImportError: cannot import name 'builder' from 'google.protobuf.internal' (C:\Users\yunpeng\anaconda3\envs\tf2\lib\site-packages\google\protobuf\internal\

How should you resolve this error?


Could you please upgrade the protobuf package as shown below and let us know?

pip install --upgrade protobuf

Thank you!

thanks,i have solved it