Reputation: 163
I am using build_image_data.py script from here:https://github.com/tensorflow/models/blob/master/inception/inception/data/build_image_data.py exactly like the documentation to convert my dataset to TFRecords format. In the inception_train.py script, when I print images and labels, labels do not correspond to the images so I can't proceed to right training. The dataset I am using is unbalanced (different number of images between classes). I also made a test using the same number of images between classes and labels are still wrong. The tensorflow code is untouched, the only change I made is not applying distortions in the image_processing.py script. I don't know if labels are wrong because of my TFR conversion or because of image_processing.py script which returns images and labels. Any ideas?
Tensorflow version: 0.10 OS: Ubuntu 14.04
The snippet of code in the inception_train.py script to check it is:
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()
Upvotes: 0
Views: 344
Reputation: 1584
You should run both at the same time: that is, only make one call to sess.run. Something like this:
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()
Upvotes: 1