models icon indicating copy to clipboard operation
models copied to clipboard

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

Open june9713 opened this issue 9 years ago • 11 comments

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!

june9713 avatar Jun 16 '17 11:06 june9713

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

happyyxw511 avatar Jun 16 '17 17:06 happyyxw511

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.

jch1 avatar Jun 16 '17 17:06 jch1

We have a pull request out to address this issue:

https://github.com/tensorflow/models/pull/1580

derekjchow avatar Jun 16 '17 17:06 derekjchow

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

aselle avatar Jun 16 '17 21:06 aselle

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

june9713 avatar Jun 17 '17 03:06 june9713

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

bsrinivas84 avatar Jun 17 '17 16:06 bsrinivas84

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

june9713 avatar Jun 17 '17 16:06 june9713

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

bsrinivas84 avatar Jun 17 '17 16:06 bsrinivas84

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

june9713 avatar Jun 17 '17 23:06 june9713

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 https://github.com/tensorflow/models/issues/1595

bsrinivas84 avatar Jun 18 '17 07:06 bsrinivas84

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

ngochuancst avatar Oct 27 '17 07:10 ngochuancst