Loading a TensorFlow graph
To load a pre-trained TensorFlow graphs in MLDB, we use the
tensorflow.graph function type .
Below, we start by creating two functions. First, the
fetcher function allows us to fetch a binary blob from a remote URL. Second, the
inception function that will be used to execute the trained network and that we parameterize in the following way:
- modelFileUrl : Path to the Inception-v3 model file. The
#separator allow us to load a file inside a zip archive. (more details)
- input : As input to the graph, we provide the output of the
fetchfunction called with the
urlparameter. When we call it later on, the image located at the specified URL will be downloaded and passed to the graph.
- output : This specifies the layer from which to return the values. The
softmaxlayer is the last layer in the network so we specify that one.