Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a TensorFlow .pb graph as a Keras Model

Tags:

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

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.

Is this possible?

like image 828
Joseph Szymborski Avatar asked Jul 04 '17 03:07

Joseph Szymborski


1 Answers

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.

like image 68
Alexandre Passos Avatar answered Oct 11 '22 12:10

Alexandre Passos