使用TensorFlow .pb图作为Keras模型 [英] Using a TensorFlow .pb graph as a Keras Model

查看:82
本文介绍了使用TensorFlow .pb图作为Keras模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用内置的TensorFlow工具对InceptionV3模型的最后一层进行了微调,以使用

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模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆