Skip to content

Commit

Permalink
Fixing an issue with the TFRecord dump.
Browse files Browse the repository at this point in the history
- The tfrecord file starts at id 0, which is incompatible with tensorflow.
It has to start at 1, 0 is reserved in Tensorflow.
Ref:https://github.com/orgs/onepanelio/projects/4#card-29786810
  • Loading branch information
Aleksandr Melnikov committed Nov 26, 2019
1 parent 3483cc9 commit 674cdce
Showing 1 changed file with 1 addition and 1 deletion.
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))
f.write(u"\tname: '{}'\n".format(label))
f.write(u'}\n\n')

Expand Down

0 comments on commit 674cdce

Please sign in to comment.