Python TF.1记录图像TENSORFLOW

Python TF.1记录图像TENSORFLOW,python,tensorflow,decode,convolutional-neural-network,tfrecord,Python,Tensorflow,Decode,Convolutional Neural Network,Tfrecord,我正在做一个Tensorflow CNN。在读取我的tf.记录时我不知道解码图像时什么类型的数据是合适的。我在多个教程中看到,在进入模型之前应该进行重塑。我想知道我做得对不对。这是我的代码: def read_file(filename_queue): #Funcion para leer el archivo tf.record, y retornamos el next recrod reader=tf.TFRecordReader() _,serialized_exam

我正在做一个Tensorflow CNN。在读取我的
tf.记录时
我不知道解码图像时什么类型的数据是合适的。我在多个教程中看到,在进入模型之前应该进行重塑。我想知道我做得对不对。这是我的代码:

def read_file(filename_queue):

   #Funcion para leer el archivo tf.record, y retornamos el next recrod
   reader=tf.TFRecordReader()
   _,serialized_example=reader.read(filename_queue)

  #Se decodifica el tf.record retornando un diccionario 
  feature={'train/image':tf.FixedLenFeature([],tf.string),
         'train/label':tf.FixedLenFeature([],tf.int64)}
  features=tf.parse_single_example(serialized_example,features=feature)

  #Convertimos el string a numeros de los decodificados features
  image=tf.decode_raw(features['train/image'],tf.float32)* (1 / 255.0)

  #Convertimos a datos
  label=tf.cast(features['train/label'],dtype=tf.int32)

  #Reshape data
  image=tf.reshape(image,[224,224,3])   

  return image,label

请发布教程链接链接:链接: