Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在tensorflow中使用经过训练的模型_Tensorflow_Classification - Fatal编程技术网

如何在tensorflow中使用经过训练的模型

如何在tensorflow中使用经过训练的模型,tensorflow,classification,Tensorflow,Classification,我在另一个程序中训练了模型“cata.tfmodel”,并在这个程序中恢复了SES,但我不知道如何使用此模型对一张图片进行分类并输出分类。 我的数据集的类型是tfrecords并按队列读取 我很困惑,如果我将一张图片转换成tfrecords,它将包含图像和标签,下一步该怎么做 img_batch, label_batch = tf.train.shuffle_batch([img, label], batch_siz

我在另一个程序中训练了模型“cata.tfmodel”,并在这个程序中恢复了SES,但我不知道如何使用此模型对一张图片进行分类并输出分类。 我的数据集的类型是tfrecords并按队列读取

我很困惑,如果我将一张图片转换成tfrecords,它将包含图像和标签,下一步该怎么做

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())