如何在tensorflow中使用经过训练的模型
我在另一个程序中训练了模型“cata.tfmodel”,并在这个程序中恢复了SES,但我不知道如何使用此模型对一张图片进行分类并输出分类。 我的数据集的类型是tfrecords并按队列读取 我很困惑,如果我将一张图片转换成tfrecords,它将包含图像和标签,下一步该怎么做如何在tensorflow中使用经过训练的模型,tensorflow,classification,Tensorflow,Classification,我在另一个程序中训练了模型“cata.tfmodel”,并在这个程序中恢复了SES,但我不知道如何使用此模型对一张图片进行分类并输出分类。 我的数据集的类型是tfrecords并按队列读取 我很困惑,如果我将一张图片转换成tfrecords,它将包含图像和标签,下一步该怎么做 img_batch, label_batch = tf.train.shuffle_batch([img, label], batch_siz
img_batch, label_batch = tf.train.shuffle_batch([img, label],
batch_size=128,capacity=2000,
min_after_dequeue=1000)
logits = cifar10.inference(img_batch)
saver = tf.train.Saver()
sess = tf.Session()
init = tf.initialize_all_variables()
sess.run(init)
saver.restore(sess,"/Tensorflow/cata.tfmodel")
tf.train.start_queue_runners(sess=sess)
此外,若我删除logits,saver将抛出ValueError:并没有要保存的变量
logits = cifar10.inference(img_batch)
saver = tf.train.Saver(tf.all_variables())