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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cvat/apps/annotation/tfrecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

f.write(u"\tname: '{}'\n".format(label))
f.write(u'}\n\n')

Expand Down