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

How to convert train TFREcord for my own dataset #22

Closed
HK017 opened this issue Mar 23, 2020 · 7 comments
Closed

How to convert train TFREcord for my own dataset #22

HK017 opened this issue Mar 23, 2020 · 7 comments
Assignees

Comments

@HK017
Copy link

HK017 commented Mar 23, 2020

please tell me, How to generate a dataset o tfrecord format? thanks a lot!!!

@mingxingtan
Copy link
Member

Working on it now. will check in the code in 1 or 2 days.

@moyans
Copy link

moyans commented Mar 23, 2020

@philip-fu
Copy link

I had some tfrecords that works fine with faster rcnn here https://github.com/tensorflow/models/tree/master/research/object_detection

But it fails with

tensorflow.python.framework.errors_impl.InvalidArgumentError: StringToNumberOp could not correctly convert string: ab3faf098c4a7147b9d6397611fdc289-crop.jpg
         [[{{node parser/StringToNumber}}]]
         [[IteratorGetNext]]

Anyone knows why?

@huangxiaosa
Copy link

e with faster rcnn here

set "image/source_id" as a number like "0" "1"...

@zishanahmed08
Copy link

@huangxiaosa could you please eleborate.
Should this line https://github.com/tensorflow/tpu/blob/master/tools/datasets/create_coco_tf_record.py#L126 ,be set to dataset_util.bytes_feature(0),

@mingxingtan
Copy link
Member

Hi all, thanks for pointing out the problems. Please don't use the tensorflow tools, since that tool is a little outdated. You can convert your dataset using the following command line:

Here are some examples:

// Download coco data.
$ wget http://images.cocodataset.org/zips/val2017.zip
$ wget http://images.cocodataset.org/annotations/annotations_trainval2017.zip
$ unzip val2017.zip
$ unzip annotations_trainval2017.zip

// convert coco data to tfrecord.
$ mkdir tfrecrod
$ PYTHONPATH=".:$PYTHONPATH" python dataset/create_coco_tfrecord.py
--image_dir=val2017
--caption_annotations_file=annotations/captions_val2017.json
--output_file_prefix=tfrecord/val
--num_shards=32

For more information, please refer to our Tutorial

@mingxingtan
Copy link
Member

I am going to close this bug now, but please feel free to reopen it if you still have problems. Thanks!

@mingxingtan mingxingtan self-assigned this Mar 24, 2020
This was referenced Mar 26, 2020
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

No branches or pull requests

6 participants