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_Feature Extraction - Fatal编程技术网

需要为tensorflow中的特征提取模型生成新模型吗?

需要为tensorflow中的特征提取模型生成新模型吗?,tensorflow,feature-extraction,Tensorflow,Feature Extraction,我在做一个图像字幕的教程。当我试着按照教程中的 在特征提取模型部分,我想知道为什么当它将include_top设置为false时,它需要基于最后一层生成新模型(image_model.layers[-1].output) 如果您试图比较image\u model.summary()和image\u features\u extract\u model.summary(),结果显然是相同的层。。谁能给我解释一下吗 image_model = tf.keras.applications.Incept

我在做一个图像字幕的教程。当我试着按照教程中的

在特征提取模型部分,我想知道为什么当它将include_top设置为false时,它需要基于最后一层生成新模型(image_model.layers[-1].output)

如果您试图比较image\u model.summary()和image\u features\u extract\u model.summary(),结果显然是相同的层。。谁能给我解释一下吗

image_model = tf.keras.applications.InceptionV3(include_top=False,
                                                weights='imagenet')
new_input = image_model.input
hidden_layer = image_model.layers[-1].output

image_features_extract_model = tf.keras.Model(new_input, hidden_layer)

这是个好问题。我看不出有什么不同。事实上,在这两个过程中运行一个随机样本,您将得到相同的输出。