Skip to content
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

The tfrecord file starts at id 0, which is incompatible with tensorflow. #869

Closed
wants to merge 1 commit into from

Conversation

benhoff
Copy link
Contributor

@benhoff benhoff commented Nov 27, 2019

It has to start at 1, 0 is reserved in Tensorflow.

Ref: #866

It has to start at 1, 0 is reserved in Tensorflow.
@@ -98,7 +98,7 @@ def create_tf_example(img_id, img_size, image_name, boxes, label_ids):
with codecs.open(os.path.join(out_dir, labelmap_file), 'w', encoding='utf8') as f:
for label, idx in label_ids.items():
f.write(u'item {\n')
f.write(u'\tid: {}\n'.format(idx))
f.write(u'\tid: {}\n'.format(idx+1))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benhoff , I see that label_ids is used below. Should be fix label_ids itself or adjust only the line? Did you reproduce the issue and the change really fix it?

@zhiltsov-max , could you please look and advise?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it should be done above, where label_ids = OrderedDict is declared.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking at this: onepanelio@674cdce

Didn't pull it down to check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants