Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot import name 'string_int_label_map_pb2'

My goal is to run tensorflow object detection API and followed the steps in the installation.

I install the tensorflow object detection API and protobuf. I have also added the path to protobuf. But the following error shoots up:

ImportError: cannot import name 'string_int_label_map_pb2'

Installed protobuf :

%%bash
cd models/research
protoc object_detection/protos/*.proto --python_out=.

A block of code containing the error import statements:

from object_detection.utils import ops as utils_ops
from object_detection.utils import label_map_util
from object_detection.utils import visualization_utils as vis_util
like image 972
Sai Krishnadas Avatar asked Dec 23 '22 18:12

Sai Krishnadas


1 Answers

Install protoc-3.11.4 from https://github.com/google/protobuf/releases

and run protoc object_detection/protos/*.proto --python_out=. as mentioned in the installation instructions. And put this file in in object detection/protos

like image 116
Mohit Chandel Avatar answered Jan 04 '23 05:01

Mohit Chandel