import tensorflow as tf

                                     features={
                                        'label':tf.FixedLenFeature([], tf.int64),
                                        'img_raw' : tf.FixedLenFeature([], tf.string),
                                     })
    image=tf.decode_raw(features['img_raw'],tf.uint8)
    label=tf.cast(features['label'],tf.int32)
    image=tf.reshape(image,[4096,1])
    return image,label

def get_batch(image,label,batch_size,crop_size):
    #print(image.shape)
    #print(label.shape)
    images,labels=tf.train.shuffle_batch([image,label],
        batch_size=batch_size,num_threads=10,capacity=10000,min_after_dequeue=200)
    return tf.reshape(images,[batch_size,4096]),tf.reshape(labels,[batch_size])

def get_test_batch(image,label,batch_size):
    images,labels=tf.train.batch([image,label],batch_size=batch_size)
    return tf.reshape(images,[batch_size,4096]),tf.reshape(labels,[batch_size])

def get_valid_batch(image,label,batch_size):
    images,labels=tf.train.batch([image,label],batch_size=batch_size)
    return tf.reshape(images,[batch_size,4096]),tf.reshape(labels,[batch_size])
    
