我正在关注此视频文本 22:22 在此代码中发现错误
.
!python {SCRIPTS_PATH + '/generate_tfrecord.py'} -x {IMAGE_PATH + '/train'} -l {ANNOTATION_PATH + '/label_map.pbtxt'} -o {ANNOTATION_PATH + '/train.record'}
!python {SCRIPTS_PATH + '/generate_tfrecord.py'} -x{IMAGE_PATH + '/test'} -l {ANNOTATION_PATH + '/label_map.pbtxt'} -o {ANNOTATION_PATH + '/test.record'}
.发布确切的错误消息,
Traceback (most recent call last):
File "D:\info\1 Master\2 semster\RealTimeObjectDetection-main\Tensorflow\scripts\generate_tfrecord.py", line 29, in <module>
from object_detection.utils import dataset_util, label_map_util
File "C:\Users\bachir\PycharmProjects\pythonProject\venv\lib\site-packages\object_detection\utils\label_map_util.py", line 29, in <module>
from object_detection.protos import string_int_label_map_pb2
File "C:\Users\bachir\PycharmProjects\pythonProject\venv\lib\site-packages\object_detection\protos\string_int_label_map_pb2.py", line 5, in <module>
from google.protobuf.internal import builder as _builder
ImportError: cannot import name 'builder' from 'google.protobuf.internal' (C:\Users\bachir\PycharmProjects\pythonProject\venv\lib\site-packages\google\protobuf\internal__init__.py)
.
首先我尝试下载一些丢失的包但同样的问题,我想帮忙
原文由 Bachir bessei 发布,翻译遵循 CC BY-SA 4.0 许可协议
按着这些次序:
builder.py
从.../Lib/site-packages/google/protobuf/internal
复制到计算机上的另一个文件夹(假设为“文档”)builder.py
从(假设为“文档”)复制到Lib/site-packages/google/protobuf/internal