使用build_image_data.py为tensorflow inceptionv3模型构建自定义数据集

时间:2017-09-14 22:20:31

标签: python-2.7 tensorflow

我想用张量流初始模型V3训练我自己的图像数据集。我正在尝试将我的数据转换为TFRecords格式。我为tfrecords创建了培训,验证和输出文件夹的文件夹。我也有我的labels_file.txt。 当我尝试使用此命令转换数据时:

bazel-bin/inception/build_image_data 
--train_directory="${TRAIN_DIR}" 
--validation_directory="${VALIDATION_DIR}" 
--output_directory="${OUTPUT_DIRECTORY}" 
--labels_file="${LABELS_FILE}" 
--train_shards=128 
--validation_shards=24 
--num_threads=8

我没有收到任何错误,但收到了一条消息:

Saving results to /tmp/
Determining list of input files and labels from /tmp/.
Found 0 JPEG files across 0 labels inside /tmp/.
Launching 2 threads for spacings: [[0, 0], [0, 0]]
2017-09-14 11:37:47.985543: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-14 11:37:47.993902: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-14 11:37:47.993969: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-09-14 11:37:48.524331 [thread 1]: Wrote 0 images to /tmp/validation-00001-of-00002
2017-09-14 11:37:48.524490 [thread 1]: Wrote 0 images to 0 shards.
2017-09-14 11:37:48.525079 [thread 0]: Wrote 0 images to /tmp/validation-00000-of-00002
2017-09-14 11:37:48.525175 [thread 0]: Wrote 0 images to 0 shards.
2017-09-14 11:37:49.364996: Finished writing all 0 images in data set.
Determining list of input files and labels from /tmp/.
Found 0 JPEG files across 0 labels inside /tmp/.
Launching 2 threads for spacings: [[0, 0], [0, 0]]
2017-09-14 11:37:49.402218 [thread 0]: Wrote 0 images to /tmp/train-00000-of-00002
2017-09-14 11:37:49.404787 [thread 0]: Wrote 0 images to 0 shards.
2017-09-14 11:37:49.405332 [thread 1]: Wrote 0 images to /tmp/train-00001-of-00002
2017-09-14 11:37:49.405367 [thread 1]: Wrote 0 images to 0 shards.
2017-09-14 11:37:50.406126: Finished writing all 0 images in data set.

我为所有文件夹使用了正确的路径,但它没有读取文件。任何人都可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

这是我的错。我忘了更新imagenet_data.py中的类和示例。