tensorflow / models

Models and examples built with TensorFlow
Other
77.03k stars 45.78k forks source link

build_image_data.py Input Label #603

Closed youngjae99 closed 6 years ago

youngjae99 commented 7 years ago

Please let us know which model this issue is about (specify the top-level directory)

I am new at TensorFlow and please help me to do what I want to do... I want to train my own Image data which locate in subdirectory. I want to convert my data to tfrecord format. My data is "size:700x800" "format:jpg".

I'm using build_image_data.py in inception/inception/data I prepare my own dataset and place those file in following directory structure..

but it seems can't read label file. I tried a lot but I couldn't solve this problem..

My label file is ' labels_file.txt ' and it contains..

0 abies_concolor 1 abies_nordmanniana 2 acer_campestre 3 salix_nigra 4 betula_nigra 5 carya_ovata

this is part of text file to show you..

The message below.. I can't solve.

/usr/bin/python3.5 "/home/youngjae/PycharmProjects/ProjectVV/build_image data.py" Saving results to /home/youngjae/ Determining list of input files and labels from /home/youngjae/leafsnap-dataset/dataset/images/lab/. Found 0 JPEG files across 0 labels inside /home/youngjae/leafsnap-dataset/dataset/images/lab/. Launching 2 threads for spacings: [[0, 0], [0, 0]] 2016-11-01 20:23:52.607983 [thread 0]: Wrote 0 images to /home/youngjae/validation-00000-of-00002 2016-11-01 20:23:52.608032 [thread 0]: Wrote 0 images to 0 shards. 2016-11-01 20:23:52.608274 [thread 1]: Wrote 0 images to /home/youngjae/validation-00001-of-00002 2016-11-01 20:23:52.608312 [thread 1]: Wrote 0 images to 0 shards. 2016-11-01 20:23:53.608400: Finished writing all 0 images in data set. Determining list of input files and labels from /home/youngjae/leafsnap-dataset/dataset/images/lab/. Found 0 JPEG files across 0 labels inside /home/youngjae/leafsnap-dataset/dataset/images/lab/. Launching 2 threads for spacings: [[0, 0], [0, 0]] 2016-11-01 20:23:53.612890 [thread 0]: Wrote 0 images to /home/youngjae/train-00000-of-00002 2016-11-01 20:23:53.612930 [thread 0]: Wrote 0 images to 0 shards. 2016-11-01 20:23:53.613180 [thread 1]: Wrote 0 images to /home/youngjae/train-00001-of-00002 2016-11-01 20:23:53.613205 [thread 1]: Wrote 0 images to 0 shards. 2016-11-01 20:23:54.613344: Finished writing all 0 images in data set.

Process finished with exit code 0

elirex commented 7 years ago

You can try to remove label numbering. According to the inception module's README, the label file doesn't need label numbering.

youngjae99 commented 7 years ago

I tried that, but it doesn't work.. :-(

aselle commented 7 years ago

Could you please take a look @shlens?

shlens commented 7 years ago

No images are found in the images directory:

Found 0 JPEG files across 0 labels inside /home/youngjae/leafsnap-dataset/dataset/images/lab/.

I would make sure that when this command runs, it first finds all of the image files you intend to process:

https://github.com/tensorflow/models/blob/master/inception/inception/data/build_image_data.py#L375

You can debug this out by running tf.gfile.Glob(jpeg_file_path) in an interactive terminal in order to determine the correct path for all of your files.

bidai541 commented 7 years ago

--labels_file Do not loss!

pavanyvs commented 7 years ago

Even I am getting the same result. I did what Shlens said and have the correct path for all my files. Can anyone help?

shlens commented 6 years ago

Closed due to inactivity.