Skip to content

no test_ckpt/ssd_inception_v2.pb file for /models/object_detection/object_detection_tutorial.ipynb #1576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
june9713 opened this issue Jun 16, 2017 · 11 comments
Labels
stat:awaiting response Waiting on input from the contributor type:bug Bug in the code

Comments

@june9713
Copy link

june9713 commented Jun 16, 2017

Thanks for your new Great object detection model.

I'm trying to test /models/object_detection/object_detection_tutorial.ipynb with jupyter notebook.

but there missing file , "test_ckpt/ssd_inception_v2.pb"

this is sample code.

PATH_TO_CKPT = os.path.join('test_ckpt', 'ssd_inception_v2.pb')

and,

with tf.gfile.GFile(PATH_TO_CKPT, 'rb') as fid:
serialized_graph = fid.read()
od_graph_def.ParseFromString(serialized_graph)
tf.import_graph_def(od_graph_def, name='')

So , PATH_TO_CKPT( = test_ckpt/ssd_inception_v2.pb) is need to run test code.

please check it and let me know how to down load this file please. :-)

Thanks for reading!

@happyyxw511
Copy link

yes, I face the same issue. Please help with it. thx

@jch1
Copy link

jch1 commented Jun 16, 2017

Hi everyone -

Thanks for reporting this --- we need to update the documentation/notebook a bit to better reflect what needs to be done.

What you can do to get it running for now is to follow the instructions here:
https://github.com/tensorflow/models/blob/master/object_detection/g3doc/detection_model_zoo.md
to download a checkpoint (you want to look for files of the form "frozen_inference_graph.pb" after un-tarring the tar.gz files) and point PATH_TO_CKPT at that .pb file. Please reach out if this doesn't work.

@derekjchow
Copy link
Contributor

We have a pull request out to address this issue:

#1580

@aselle
Copy link
Contributor

aselle commented Jun 16, 2017

@june9713, does @derekjchow's pr address your needs?

@aselle aselle added stat:awaiting response Waiting on input from the contributor type:bug Bug in the code labels Jun 16, 2017
@june9713
Copy link
Author

@aselle , It is updated! Now I can run test code now! Thanks! :-)
@jch1 Really appreciate to you.
@derekjchow Thanks!!

@bsrinivas84
Copy link

On Windows OS, I was getting this error
NotFoundError: NewRandomAccessFile failed to Create/Open: test_ckpt\ssd_inception_v2.pb : The system cannot find the file specified.

I downloaded the file "ssd_inception_v2_coco" and extracted the tar , renamed it to ssd_inception_v2.pb, now I get the below error


DecodeError Traceback (most recent call last)
in ()
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='')

c:\program files\anaconda3\lib\site-packages\google\protobuf\message.py in ParseFromString(self, serialized)
183 """
184 self.Clear()
--> 185 self.MergeFromString(serialized)
186
187 def SerializeToString(self):

c:\program files\anaconda3\lib\site-packages\google\protobuf\internal\python_message.py in MergeFromString(self, serialized)
1061 length = len(serialized)
1062 try:
-> 1063 if self._InternalParse(serialized, 0, length) != length:
1064 # The only reason _InternalParse would return early is if it
1065 # encountered an end-group tag.

c:\program files\anaconda3\lib\site-packages\google\protobuf\internal\python_message.py in InternalParse(self, buffer, pos, end)
1087 if field_decoder is None:
1088 value_start_pos = new_pos
-> 1089 new_pos = local_SkipField(buffer, new_pos, end, tag_bytes)
1090 if new_pos == -1:
1091 return pos

c:\program files\anaconda3\lib\site-packages\google\protobuf\internal\decoder.py in SkipField(buffer, pos, end, tag_bytes)
848 # The wire type is always in the first byte since varints are little-endian.
849 wire_type = ord(tag_bytes[0:1]) & wiretype_mask
--> 850 return WIRETYPE_TO_SKIPPER[wire_type](buffer, pos, end)
851
852 return SkipField

c:\program files\anaconda3\lib\site-packages\google\protobuf\internal\decoder.py in _SkipGroup(buffer, pos, end)
797 while 1:
798 (tag_bytes, pos) = ReadTag(buffer, pos)
--> 799 new_pos = SkipField(buffer, pos, end, tag_bytes)
800 if new_pos == -1:
801 return pos

c:\program files\anaconda3\lib\site-packages\google\protobuf\internal\decoder.py in SkipField(buffer, pos, end, tag_bytes)
848 # The wire type is always in the first byte since varints are little-endian.
849 wire_type = ord(tag_bytes[0:1]) & wiretype_mask
--> 850 return WIRETYPE_TO_SKIPPER[wire_type](buffer, pos, end)
851
852 return SkipField

c:\program files\anaconda3\lib\site-packages\google\protobuf\internal\decoder.py in _RaiseInvalidWireType(buffer, pos, end)
818 """Skip function for unknown wire types. Raises an exception."""
819
--> 820 raise _DecodeError('Tag had invalid wire type.')
821
822 def _FieldSkipper():

DecodeError: Tag had invalid wire type.

Please help solve

@june9713
Copy link
Author

@bsrinivas84 source code is updated. please re-download and check what is changed. new source code is working correctrly.

@bsrinivas84
Copy link

bsrinivas84 commented Jun 17, 2017

Thanks June9713 for quick response.
With the new code as well as old code, forgot to mention that in prior step "Object detection imports" I am getting the following error

=============
ImportError Traceback (most recent call last)
in ()
----> 1 from utils import label_map_util
2
3 from utils import visualization_utils as vis_util

D:\Personal\learn\ML\DL\Tensorflow\Official-Tutorial\models-master\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'

To workaround/proceed I commented the following line in "label_map_util.py"
from object_detection.protos import string_int_label_map_pb2

But I am now getting error at step "Loading label map"
NameError: name 'string_int_label_map_pb2' is not defined

So need your help to solve the error in step "Object detection imports"
Appreciate the help to proceed further

@june9713
Copy link
Author

@bsrinivas84
from object_detection.protos import string_int_label_map_pb2 --> from protos import string_int_label_map_pb2
:-)

@bsrinivas84
Copy link

Thanks June, I did multiple edits to try get it working. It works now..Many Thanks to your quick inputs. Also had to do this #1595

@ngochuancst
Copy link

with your error? You should prepare the following libraries and note some things .

  1. Are you sure you are building on any python version? python 2.7 or python 3.6
  2. check tensorflow version, and needs tensorflow >= 1.2.0. and how to install or upgrade then you can search.
  3. You need to prepare all the files for pythonc to be able to build. If you refer to it at https://github.com/tensorflow/models/tree/master/research/object_detection.
    4.You modify the file path and variables in the previous program to match before building
  4. good luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting response Waiting on input from the contributor type:bug Bug in the code
Projects
None yet
Development

No branches or pull requests

7 participants