inception v3 网络中的错误标签 (Tensorflow)

Wrong labels in the inception v3 network (Tensorflow)

我正在使用此处的 build_image_data.py 脚本:https://github.com/tensorflow/models/blob/master/inception/inception/data/build_image_data.py 与将我的数据集转换为 TFRecords 格式的文档完全一样。在 inception_train.py 脚本中,当我打印图像和标签时,标签与图像不对应,因此我无法进行正确的训练。我使用的数据集是不平衡的(类 之间的图像数量不同)。我还在 类 之间使用相同数量的图像进行了测试,但标签仍然是错误的。 tensorflow 代码未受影响,我所做的唯一更改是不在 image_processing.py 脚本中应用扭曲。我不知道标签是否错误是因为我的 TFR 转换,还是因为 image_processing.py 脚本 returns 图像和标签。有什么想法吗?

张量流版本:0.10 OS: Ubuntu 14.04

inception_train.py 脚本中检查它的代码片段是:

labs = sess.run(labels)
imgs = sess.run(images)


for i in range(FLAGS.batch_size):
  print('Label ' + str(labs[i]))
  plt.imshow(imgs[i, :, :, :])
  plt.show()

您应该同时 运行 两者:也就是说,只调用一次 sess.run。像这样:

imgs,labs = sess.run([images,labels])# ONLY ONE CALL 

for i in range(FLAGS.batch_size):
    print('Label ' + str(labs[i]))
    plt.imshow(imgs[i, :, :, :])
    plt.show()