问题描述
我已经使用内置的TensorFlow工具对InceptionV3模型的最后一层进行了微调,以使用本教程.这会产生一堆瓶颈和一个TensorFlow图(* .pb文件).
I've used the built-in TensorFlow tools to fine-tune the last layers of the InceptionV3 model to classify items on a custom dataset by using this tutorial. This generates a bunch of bottlenecks and a TensorFlow graph (*.pb file).
我想将* .pb TF图导入Keras,就像使用* .hdf5文件包含模型的权重一样.原因是,在使用此模型时,我想利用Keras编写的一些工具.
I'd like to import the *.pb TF graph into Keras, much like you would with an *.hdf5 file that contains the weights of a model. The reason being is that there are some tools written in Keras I would like to leverage while using this model.
这可能吗?
推荐答案
截至2017年7月,Keras只能导入Keras模型,而不能导入原始tf图.这是因为Keras包含一些元数据,这些元数据本身并未保留为tf图的一部分,并且不容易重构.
As of july 2017 Keras can only import Keras models and not raw tf graphs. This is because Keras has some metadata which is not itself kept as a part of the tf graph and can't be easily reconstructed.
这篇关于使用TensorFlow .pb图作为Keras模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!