I have 3500 image in my system. I want to attach label each image to make learn So I made answer list
local_name = {'grassland': '[1,0,0,0,0,0,0]', 'canyon':'[0,1,0,0,0,0,0]', 'forest':'[0,0,1,0,0,0,0]',
'king\'s load':'[0,0,0,1,0,0,0]', 'lake':'[0,0,0,0,1,0,0]', 'desert':'[0,0,0,0,0,1,0]', 'ruin':'[0,0,0,0,0,0,1]'}
answer = []
def make_answer():
for i in range (0, 3500):
if i<500 :
answer.append(local_name['grassland'])
elif i<1000 :
answer.append(local_name['canyon'])
elif i<1500 :
answer.append(local_name['forest'])
elif i<2000 :
answer.append(local_name['king\'s load'])
elif i<2500 :
answer.append(local_name['lake'])
elif i<3000 :
answer.append(local_name['desert'])
elif i<3500 :
answer.append(local_name['ruin'])
else :
print("not exist")
and I put into queue
def input_pipeline(batch_size,train_logical = True):
images = ['img/background/back_{}.png'.format(i) for i in range(0,3500)]
image_queue = tf.train.string_input_producer([images,answer],shuffle=False) #error point
image,label = read_image_files(image_queue)
min_after_dequeue = 5000
capacity = min_after_dequeue + 3*batch_size
example_batch, label_batch = tf.train.shuffle_batch([image,label],batch_size=batch_size,capacity=capacity,min_after_dequeue=min_after_dequeue)
print(example_batch.shape,label_batch.shape)
return (example_batch, label_batch)
ValueError: Shapes (3500,) and () are not compatible
size of answer, images are both 3500 How can I solve it?