ImportError Traceback (most recent call last)
----> 1 from utils import label_map_util
2
3 from utils import visualization_utils as vis_util
~/lab/dl/models/object_detection/utils/label_map_util.py in
20 import tensorflow as tf
21 from google.protobuf import text_format
---> 22 from object_detection.protos import string_int_label_map_pb2
23
24
ImportError: cannot import name 'string_int_label_map_pb2'
you forgot to run this
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)
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 :-)
@june9713 Pls copy full of your error message. You may need absolute path . Also, transfer learning = train from previous model. You can check here when train in google cloud . But i can not understand why copy previous model to GCS Bucket.
can help us to use transfer learning and how can i do same thing when run from local
I think you just need to put the model for transfer learning(eg. VGG or Resnet) in a folder and specify the path in the config file.
For pascal_voc, the model configuration says num_classes=20 but the label_map file has an extra class with id=0 and name='none_of_the_above'. Why is this extra label added?
Background.
Hello, I am in windows OS and downloaded protoc-3.3.0-win32.zip, after run protoc.exe object_detection\protos\*.proto --python_out=.
, I got a bunch of extra files in the object_detection/protos directory of the form "xxx_pb2.py".
But I still cannot run python object_detection\builders\model_builder_test.py
.
Error is
So what is wrong?
@daniel0720
This is simple reason....
Run cmd as administrator.
you need to run "python3 setup.py build " and "python3 setup.py install" in models folder and /models/slim folder as Superuser(administrator).
After that, you can run run test, but if you try to run train, you will meet error again...
I wanna tell you reason... but it is too much log histoy about diff of py3 and py2.
I think you can solve it if you know what is diff py2 and py3,
otherwise, you should bring someones help. :-)
@june9713 Thank you very much. I know some diff py2 and py3.
I had the same problem. I changed my working directory to where the utils were:
os.chdir('.../anaconda/lib/python3.6/site-packages/tensorflow/models')
And the the code worked fine:
from object_detection.utils import label_map_util
from object_detection.utils import visualization_utils as vis_util
@kaseyriver11 Copy folder to site packages is good solution, but most easy way and clean way is setup.py insatll at models folder and slim folder to install models library. :-) Just type setup.py install at models folder and slim folder!
Hi all, I had the same problem on ubuntu 16.04
tried:
cpchung:models$ uname -a
Linux microway 4.8.0-56-generic #61~16.04.1-Ubuntu SMP Wed Jun 14 11:58:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
cpchung:models$ protoc --version
libprotoc 3.2.0
protoc object_detection/protos/*.proto --python_out=.
python setup.py install
no warning message found from these, but not working in jupyter-notebook
@chakpongchung Why dont you show Error message?
@june9713
ImportError Traceback (most recent call last)
----> 1 from utils import label_map_util
2 from utils import visualization_utils as vis_util
/local/home/cpchung/software/models/object_detection/utils/label_map_util.py in
20 import tensorflow as tf
21 from google.protobuf import text_format
---> 22 from object_detection.protos import string_int_label_map_pb2
23
24
ImportError: cannot import name string_int_label_map_pb2
@chakpongchung
Do you use anaconda?
Or... is your notebook kernal python2?
Run python in console.
And type "import object_detection"
If there is no error, you need to find out what is kerneal in jupyter notebook
cpchung:~$ python
Python 2.7.13 |Anaconda custom (64-bit)| (default, Dec 20 2016, 23:09:15)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import object_detection
>>>
My notebook kernel is python2
@chakpongchung
I dont use anaconda... So I dont know what happens exactly.
In my guess , your "setup.py" copies files to your conda path.
but your notebook is finding packages from your pure python2.7 path.
you need to test "import object_detection" in notebook.
What do you think?
@june9713
Thanks for your feedback. But:
cpchung:models$ which jupyter-notebook
/local/home/cpchung/anaconda2/bin/jupyter-notebook
I download the models: https://github.com/tensorflow/models
I installed all and I do in directory: /models-master/:
$ protoc object_detection/protos/*.proto --python_out=.
$ export PYTHONPATH=$PYTHONPATH:pwd
:pwd
/slim
$ python object_detection/builders/model_builder_test.py
All fine, but, If I try do:
https://github.com/tensorflow/models/blob/master/object_detection/g3doc/running_locally.md
First I download annotations and images in directory: /object_detection/ , and I do in directory: /models-master/object_detection/
$ tar -xvf annotations.tar.gz
$ tar -xvf images.tar.gz
$ python create_pet_tf_record.py --data_dir=pwd
--output_dir=pwd
In the pipeline I use the "faster_rcnn_resnet101_pets.config" and I changed the next:
fine_tune_checkpoint: "/home/fperez/Descargas/models-master/object_detection/model.ckpt"
I don't know, where the model.ckpt is. The other change is:
"""
train_input_reader: {
tf_record_input_reader {
input_path: "/home/fperez/Descargas/models-master/object_detection/pet_train.record"
}
label_map_path: "/home/fperez/Descargas/models-master/object_detection/data/pet_label_map.pbtxt"
}
eval_config: {
num_examples: 2000
}
eval_input_reader: {
tf_record_input_reader {
input_path: "/home/fperez/Descargas/models-master/object_detection/pet_val.record"
}
label_map_path: "/home/fperez/Descargas/models-master/object_detection/data/pet_label_map.pbtxt"
}
"""
I do in directory: /models-master/
$ python object_detection/train.py --logtostderr --pipeline_config_path=object_detection/ --train_dir=object_detection/
and I had the next error:
"""
Traceback (most recent call last):
File "object_detection/train.py", line 198, in
tf.app.run()
File "/home/fperez/.local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "object_detection/train.py", line 143, in main
model_config, train_config, input_config = get_configs_from_pipeline_file()
File "object_detection/train.py", line 103, in get_configs_from_pipeline_file
text_format.Merge(f.read(), pipeline_config)
File "/home/fperez/.local/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py", line 125, in read
pywrap_tensorflow.ReadFromStream(self._read_buf, length, status))
File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
self.gen.next()
File "/home/fperez/.local/lib/python2.7/site-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.FailedPreconditionError: object_detection
"""
But, when I do "import object_detection" in python terminal, It works fine. What is it my problem? Sorry for the inconvenience
@FPerezHernandez92 Oh I have same problem either!! So I remove that line inconfig file. Then it works fine but, After traning, Problem occurs when I try freeze ckpt file to .pb file. And I found it is beacause of I removing line about model.ckpt from config file. Im trying to find answer but still didnt. I will let you know If I find somthing :-)
What line do you say? @june9713 Because, I comment the line:
fine_tune_checkpoint: "/home/fperez/Descargas/models-master/object_detection/model.ckpt"
And I have the same error than my other message.
@FPerezHernandez92 Do you install object_detection api to your pc? You need to do setup.py on /models/ folder.
@june9713 Yes, I do in directory "models-master/:
$ python setup.py sdist
$ (cd slim && python setup.py sdist )
But the problem, when I do:
$ python object_detection/train.py --logtostderr --pipeline_config_path=object_detection/ --train_dir=object_detection/
Is the same that I say in the other message.
@Anuraag-Advani have you managed to tackle the problem of
```
DecodeError Traceback (most recent call last)
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
``` ?
No
I run the following command in /tensorflow/model
protoc object_detection/protos/.proto --python_out=.
but it returns the following error.
object_detection/protos/.proto: Invalid argument
Is there anyone could help me? I used anaconda3-4.2.0, tensorflow1.2.1 on windows8.1.
the problem solved. I run .proto file one by one.
Do they have to be ran one by one or is there a better way?
I got same problem, solved by rerunning
export PYTHONPATH=$PYTHONPATH:'pwd':'pwd'/slim
Problem: single quote used for pwd was in some special character, type it after deleting from keyboard.
download the protoc_3.3,can solve this problem
$ mkdir protoc_3.3
$ cd protoc_3.3
protoc_3.3$ wget wget https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip
protoc_3.3$ chmod 775 protoc-3.3.0-linux-x86_64.zip
protoc_3.3$ unzip protoc-3.3.0-linux-x86_64.zip
cd ../tensorflow/models/
../tensorflow/models$ home/../protoc_3.3/bin/protoc object_detection/protos/*.proto --python_out=.
@roblee357 try to add * like this: protoc object_detection/protos/*.proto --python_out=.
I have passed builder_test.py, but when I try to run locally as in running_locally.md I got following issues:
Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 198, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 44, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 141, in main assert FLAGS.train_dir, 'train_dir is missing.' AssertionError: train_dir is missing.
then I tried to set default train_dir in trian.py instead of by command line, but another issue occurs:
File "/data/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.FailedPreconditionError: .
any suggestion would be grateful~please help...
How do i resolve this in windows 10?
File "generate_tfrecord.py", line 20, in
from object_detection.utils import dataset_util
ModuleNotFoundError: No module named 'object_detection'
@rohitsubramani
Dear.
You have to install object detection.
setup.py install
how do i do it in windows
On Sun, Oct 15, 2017 at 9:10 AM, june9713 notifications@github.com wrote:
@rohitsubramani https://github.com/rohitsubramani
Dear.
You have to install object detection.
setup.py install—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/models/issues/1591#issuecomment-336684029,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Aea2g0tWPfv2NG1aacjx-1jmkHgrXXzXks5ssX60gaJpZM4N9GuK
.
when i tried to train pet detecter tutorials followed by instructions steps by steps, i 've already added PYTHONPATH, and run model_test.py successfully, and meantime, i 've added export pythonpath in bashrc manually,and successfully, however, i executed the code to transfer pet_tf_record, it occurred the error as follows like;
/usr/local/lib/python3.5/dist-packages/tensorflow/models/research$ sudo python object_detection/create_pet_tf_record.py --label_map_path=object_detection/data/pet_label_map.pbtxt --data_dir=pwd --output_dir=pwd
Traceback (most recent call last):
File "object_detection/create_pet_tf_record.py", line 39, in
from object_detection.utils import dataset_util
ImportError: No module named object_detection.utils
how to solve it?plz tell me why?
@rohitsubramani
i got the same error like you, so how do you solve it?
ModuleNotFoundError: No module named 'object_detection'
@yhmybzc The same command does not work on my Windows 10.
protoc object_detection/protos/.proto --python_out=.
This will show error message: object_detection/protos/.proto: No such file or directory.
But those directories and files do exist.
The only working solution is as @gustavkkk mentioned, run those .proto files one by one
Anyone know why?
@ybsave Not in this thread but I saw that "*.proto" to specify all proto extension files does not work on the windows command prompt so we need to put all of the files one by one as @gustavkkk mentioned. You can copy and paste following script to do that. This works for me.
protoc --python_out=. .\object_detection\protos\anchor_generator.proto .\object_detection\protos\argmax_matcher.proto .\object_detection\protos\bipartite_matcher.proto .\object_detection\protos\box_coder.proto .\object_detection\protos\box_predictor.proto .\object_detection\protoseval.proto .\object_detection\protos\faster_rcnn.proto .\object_detection\protos\faster_rcnn_box_coder.proto .\object_detection\protos\grid_anchor_generator.proto .\object_detection\protos\hyperparams.proto .\object_detection\protos\image_resizer.proto .\object_detection\protos\input_reader.proto .\object_detection\protos\losses.proto .\object_detection\protos\matcher.proto .\object_detection\protos\mean_stddev_box_coder.proto .\object_detection\protos\model.proto .\object_detection\protos\optimizer.proto .\object_detection\protos\pipeline.proto .\object_detection\protos\post_processing.proto .\object_detection\protos\preprocessor.proto .\object_detection\protos\region_similarity_calculator.proto .\object_detection\protos\square_box_coder.proto .\object_detection\protos\ssd.proto .\object_detection\protos\ssd_anchor_generator.proto .\object_detection\protosstring_int_label_map.proto .\object_detection\protos\train.proto
@jingyibo123
Try deleting the "build" file in the slim folder. The setup.py worked for me after that.
But it created another error.
ImportError: No module named 'nets.nasnet'
Hi @karkinissan Oups I actually renamed it to BUILD2 now everything's working fine that's why I deleted the original comment. Not sure about your case though.
Hi @yoonsj I tried your script to compile the python executable protobuf files. When I ran python object_detection/builders/model_builder_test.py, I got: File "C:\Users\User\New\Anaconda3\envs\tensorflow\lib\site-packages\object_detection-0.1-py3.5.egg\object_detection\protos\box_coder_pb2.py", line 17, in
ImportError: cannot import name 'keypoint_box_coder_pb2'
I noticed that in your script ".\object_detection\protos\keypoint_box_coder.proto" was missing and added it which did produce keypoint_box_coder_pb2.py.
However, I still get the same error. What am I possibly missing?
Any help would be greatly appreciated.
Hi @KimmoOjala I found that the tensorflow object detection package has been changed. In the package I've downloaded, it does not require "keypoint_box_coder.proto" as follows, but updated package requires "keypoint_box_coder.proto." Did you check that "keypoint_box_coder.proto" is in "/protos" directory? If yes, check if "keypoint_box_coder_pb2.py" is generated after you built.
syntax = "proto2";
package object_detection.protos;
import "object_detection/protos/faster_rcnn_box_coder.proto";
import "object_detection/protos/mean_stddev_box_coder.proto";
import "object_detection/protos/square_box_coder.proto";
// Configuration proto for the box coder to be used in the object detection
// pipeline. See core/box_coder.py for details.
message BoxCoder {
oneof box_coder_oneof {
FasterRcnnBoxCoder faster_rcnn_box_coder = 1;
MeanStddevBoxCoder mean_stddev_box_coder = 2;
SquareBoxCoder square_box_coder = 3;
}
}
Thanks for your help. It works for me now. I just had to build it again.
BR, Kimmo
2017-11-09 19:14 GMT+02:00 Su-Jong notifications@github.com:
Hi @KimmoOjala https://github.com/kimmoojala I found that the
tensorflow object detection package has been changed. In the package I've
downloaded, it does not require the keypoint_box_coder_pb2 as follows, but
updated package requires "keypoint_box_coder.proto." Did you check that
"keypoint_box_coder.proto" is in "/protos" directory? If yes, check if
"keypoint_box_coder_pb2.py" is generated after you built.syntax = "proto2";
package object_detection.protos;
import "object_detection/protos/faster_rcnn_box_coder.proto";
import "object_detection/protos/mean_stddev_box_coder.proto";
import "object_detection/protos/square_box_coder.proto";// Configuration proto for the box coder to be used in the object detection
// pipeline. See core/box_coder.py for details.
message BoxCoder {
oneof box_coder_oneof {
FasterRcnnBoxCoder faster_rcnn_box_coder = 1;
MeanStddevBoxCoder mean_stddev_box_coder = 2;
SquareBoxCoder square_box_coder = 3;
}
}—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/models/issues/1591#issuecomment-343224791,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AdOpxkf55d0ahoGhgEBJfbNWwbFSGDhZks5s0zLzgaJpZM4N9GuK
.
I donno If you guys got this. Didn't go through the full post.
The solution I got is really weird. I am using Its really weird version: protoc-3.3.0-win32.zip, shared above by @astrung after using all the latest versions. I was still facing issues though.
As soon I moved the object_detection folder inside the bin, it worked like a charm.. Cheers.
@Anuraag-Advani @vallettea were you guys able to resolve
DecodeErrorTraceback (most recent call last)
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
amrita@amrita-VirtualBox:~/Downloads/models/research/object_detection$ python3 train.py
WARNING:tensorflow:From /home/amrita/.local/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py:198: retry (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Use the retry module or similar alternatives.
Traceback (most recent call last):
File "train.py", line 167, in
tf.app.run()
File "/home/amrita/.local/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run
_sys.exit(main(argv))
File "train.py", line 88, in main
assert FLAGS.train_dir, 'train_dir
is missing.'
AssertionError: train_dir
is missing.
I am having this error while running python3 train.py
Thanks if anyone can help.
In Windows system protoc object_detection/protos/.proto --python_out=. is not working.
I think command "protos/.proto" is not working in windows system.
So you should enter the command for every file in protos folder.
like "protoc image_resizer.proto --python_out=." (#From tensorflow/models/object_detection/protos/
(image_resizer.proto is a exmaple name. you should do it for every .proto file)
Then you can see .pb files in protos folder, if it is worked.
I am on ubunto 16.04. After running command
./protoc ../../research/object_detection/protos/*.proto --python_out=.
I get this error.
../../research/object_detection/protos/anchor_generator.proto: File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think).
Any help would be appreciated. Thanks
Works for me(protoc.exe v3.4.0):
E:\$\tf\models-master\research>protoc.exe object_detection/protos/*.proto --python_out=.
What finally worked for me was moving the proto files to the folder site-packages/object_detection-0.1-py3.6.egg (I have no idea when this folder was formed but thats where label_map_util was trying to access the proto files.) Seems to be an issue with the path with which utils tries to access its neccesary components. 3 days of headache.. and now on to the next chapter!
when i run this in my anaconda prompt : (tensorflow3) c:\tensorflow3\models\research\object_detection>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/ssd_mobilenet_v1_coco.config
(it shows)
google.protobuf.text_format.ParseError: 71:12 : Message type "object_detection.protos.Hyperparams" has no field named "7".
(that error)
whats the pb ..please help me ...
Traceback (most recent call last):
File "C:\tensorflow\models-master\research\object_detection\object_detection_tutorial.py", line 17, in
import tensorflow as tf
File "C:\Users\Mr. Khan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow__init__.py", line 24, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\Mr. Khan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python__init__.py", line 59, in
from tensorflow.core.framework.graph_pb2 import *
File "C:\Users\Mr. Khan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 6, in
from google.protobuf import descriptor as _descriptor
File "C:\Users\Mr. Khan\AppData\Local\Programs\Python\Python36\lib\site-packages\google\protobuf\descriptor.py", line 47, in
from google.protobuf.pyext import _message
ImportError: DLL load failed: The specified procedure could not be found.
please help me!
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?
Hi i run this command but i get the error no such file or directory what should i do ?
To solve this problem you need to run protoc object_detection/protos/*.proto --python_out=. from the path of the protoc location.
Then if you are using any model from object detection then what you NEED to do is create your program inside of object_detection. There is a way to set it up elsewhere and create a path to it but I suggest starting it from inside of object_detection folder
To solve this issue please be sure to use protoc-3.4.0-win32 for windows 10 (3.9.0 not working). Then in by calling cmd in models/research folder
"C:/tensorflow1/protoc/bin/protoc" object_detection/protos/*.proto --python_out=.
PS: protoc's unzipped bin folder already moved to main root folder of project (i.e. c:/tensorflow1)
(test1) D:\tensorflow\models\research\object_detection>python generate_tfrecord.py --csv_input=images\test_labels.csv --image_dir=images\test --output_path=test.record
Traceback (most recent call last):
File "generate_tfrecord.py", line 20, in
from object_detection.utils import dataset_util
ModuleNotFoundError: No module named 'object_detection'
how can i slove it please help me!
Hi.i ran
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?Hi i run this command but i get the error no such file or directory what should i do ?
Hi.me too.Could you solve the problem?
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?Hi i run this command but i get the error no such file or directory what should i do ?
Hi.me too.Could you solve it?
I am building my own object detector by following this * https://towardsdatascience.com/creating-your-own-object-detector-ad69dda69c85 * tutorial.
Theproblem is whenver I am executing this *python generate_tfrecord.py --csv_input=images\train_labels.csv --image_dir=images\train --output_path=train.record
* command I am getting this error:
Traceback (most recent call last):
File "generate_tfrecord.py", line 20, in
from object_detection.utils import dataset_util
ModuleNotFoundError: No module named 'object_detection'
Any Ideas?
Could you execute below commands before running "python generate_tfrecord.py"
protoc object_detection/protos/*.proto --python_out=.
export PYTHONPATH=$PYTHONPATH:pwd
:pwd
/slim
If someone stills getting the same error, I imported the following to get rid of it:
import sys
sys.path
sys.path.insert(0, 'ON_YOUR_PC/object_detection')
sys.path.append("..")
from object_detection.utils import ops as utils_ops
from protos import string_int_label_map_pb2
from utils import visualization_utils as vis_util
(finalthesis) C:\tensorflow\models\research\object_detection>python generate_tfrecord.py --csv_input=images/train_labels.csv --image_dir=images/train --output_path=train.record
Traceback (most recent call last):
File "generate_tfrecord.py", line 17, in
import tensorflow as tf
File "C:\Users\Robuca\Anaconda3\envs\finalthesis\lib\site-packages\tensorflow__init__.py", line 24, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\Robuca\Anaconda3\envs\finalthesis\lib\site-packages\tensorflow\python__init__.py", line 59, in
from tensorflow.core.framework.graph_pb2 import *
File "C:\Users\Robuca\Anaconda3\envs\finalthesis\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 15, in
from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2
File "C:\Users\Robuca\Anaconda3\envs\finalthesis\lib\site-packages\tensorflow\core\framework\node_def_pb2.py", line 15, in
from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
File "C:\Users\Robuca\Anaconda3\envs\finalthesis\lib\site-packages\tensorflow\core\framework\attr_value_pb2.py", line 15, in
from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
File "C:\Users\Robuca\Anaconda3\envs\finalthesis\lib\site-packages\tensorflow\core\framework\tensor_pb2.py", line 15, in
from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
File "C:\Users\Robuca\Anaconda3\envs\finalthesis\lib\site-packages\tensorflow\core\framework\resource_handle_pb2.py", line 91, in
__module__ = 'tensorflow.core.framework.resource_handle_pb2'
TypeError: expected bytes, Descriptor found
plsss help me this error..
how can i fix this error..
Im using tensorflow CPU..
I don't have graphics card for GPU
Most helpful comment
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 importstring_int_label_map_pb2