In object_detection_tutorial
ImportError Traceback (most recent call last)
~/lab/dl/models/object_detection/utils/label_map_util.py in
ImportError: cannot import name 'string_int_label_map_pb2'
you forgot to run this #From tensorflow/models/ protoc object_detection/protos/*.proto --python_out=.
I get an equal error after running
#From tensorflow/models/
protoc object_detection/protos/*.proto --python_out=.
Traceback (most recent call last):
File "create_pet_tf_record.py", line 40, in <module>
from object_detection.utils import label_map_util
File "/home/chris/tensorflow-models/models/object_detection/utils/label_map_util.py", line 22, in <module>
import string_int_label_map_pb2
ImportError: No module named string_int_label_map_pb2
@chbaumgaertner - Were there an error messages when you ran the protoc command? If it was successful, then you should see a bunch of extra files in the object_detection/protos directory of the form "xxx_pb2.py"
from object_detection.protos import string_int_label_map_pb2
Got this error, shouldn't it be
from protos import string_int_label_map_pb2
@jessyuan24 @zakizhou @chbaumgaertner @jch1 @Anuraag-Advani
I found some of reason. but I dont know how to solve it. ipython notebook example file is in "object_detection" folder. So , print(os.getcwd()) will show you "/models/object_detection" but , "from object_detection.utils import label_map_util" this line load utils from "/models" current directory "/models/object_detection" but utils recognize current directory as "/models" So, one trick is work. "from object_detection.utils import label_map_util" --> "from utils import label_map_util" And it works.
But this is just trick. this is not perfact solution. somebody can solve this in windows enviorment please?
Hi guys,
I had the same problem. But after running the
protoc object_detection/protos/*.proto --python_out=.
it worked fine.
But my classes name and scores are not printed. Any suggestions? do I need to raise a separate issue?
@Vikramank jessyuan24 is aleady run protoc, but he said error is still showing. And I've had same problem in windows. :-)
@june9713 Maybe I should install protoc first
@jessyuan24 Do you use windows virsion? or linux? If you are using windows, try my suggestion. :-)
@june9713 your trick worked for now, thanks!
@june9713 @jessyuan24 great!
I'm getting this when trying to run protoc
~/models# protoc object_detection/protos/*.proto --python_out=.
object_detection/protos/anchor_generator.proto:11:3: Expected "required", "optional", or "repeated".
object_detection/protos/anchor_generator.proto:11:32: Missing field number.
Any ideas? Using the dl-docker image on a Mac
EDIT: fixed - https://github.com/tensorflow/models/issues/1570
I am not being able to use any model but the 'ssd_mobilenet_v1_coco_11_06_2017' one. I get this error with 'MODEL_NAME = 'faster_rcnn_resnet101_coco_11_06_2017''
DecodeError Traceback (most recent call last)
<ipython-input-57-57652895f483> in <module>()
4 with tf.gfile.GFile(PATH_TO_CKPT, 'rb') as fid:
5 serialized_graph = fid.read()
----> 6 od_graph_def.ParseFromString(serialized_graph)
7 tf.import_graph_def(od_graph_def, name='')
DecodeError: Error parsing message
@june9713 No, I use mac osx
For window users : Use protobuf binary : protoc-3.3.0-win32.zip then : \link\to\protoc object_detection/protos/*.proto --python_out=. > then you can import string_int_label_map_pb2
Also, can we using transfer-learning for running locally ? i see that we have a doc about transfer learning on cloud but i can not find any documents that write about transfer learning on local machine . I expected it in pipeline but i can not find it. So how can we config transfer learning on running locally
how to run this command? protoc object_detection/protos/*.proto --python_out=.
cmd or python is error
C:\Users\insor\Downloads\protoc-3.3.0-win32\bin>protoc.exe to C:\Users\insor\Desktop\k35 main\object detection\object_detection/protos/*.proto --python_out=. to: No such file or directory
@astrung Thanks it works. @insort protoc install at https://github.com/google/protobuf
Also, can any one know about how to config for transfer learning on local machine ?
@astrung transfer learning? Could you tell me what does it mean? Actually , I wanna train from scratch , but many error is occured. I followed instruction from "Quick Start: Training a pet detector" and "Running locally" (is mixed)
1 . I downloaded pet image files and annotate files from http://www.robots.ox.ac.uk/~vgg/data/pets/
-
pet_label_map.pbtxt is already exist in data folder.
-
make record file(https://github.com/tensorflow/models/blob/master/object_detection/g3doc/running_pets.md) python object_detection/create_pet_tf_record.py
--label_map_path=object_detection/data/pet_label_map.pbtxt
--data_dir=pwd
--output_dir=pwd -
most confusing thing is pipeline config file. I dont know how to make config file exactly. /models/object_detection/samples/configs/ directory has some of sample config files. I just choose one file. I choose "faster_rcnn_resnet101_pets.config"
-
edit faster_rcnn_resnet101_pets.config . some of directory and file path should be changing
-
Now all ready is done.( I think) Lets start traingin.(https://github.com/tensorflow/models/blob/master/object_detection/g3doc/running_locally.md)
my pipeline_config_path is : '~/Desktop/models/object_detection/models/models/faster_rcnn_resnet101_pets.config' my train_dir is : ~/Desktop/models/object_detection/models/models/train
run below:
python object_detection/train.py --logtostderr
--pipeline_config_path='~/Desktop/models/object_detection/models/models/faster_rcnn_resnet101_pets.config'
--train_dir=~/Desktop/models/object_detection/models/models/train
But failed.
Error Message is as below.
tensorflow.python.framework.errors_impl.NotFoundError: ~/Desktop/models/object_detection/models/models/faster_rcnn_resnet101_pets.config
It means pipeline_config file is not exist. But file is obiously exist!! So I dont know reason. Im finding the reason. If anybody have idea , please help me. Thnaks :-)