O'Reilly logo

Hands-On Serverless Deep Learning with TensorFlow and AWS Lambda by Rustem Feyzkhanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

TensorFlow code for Inception v3

Now, let's see how the code for any Inception v3 model will look like:

  1. First, we need to set up a TensorFlow session. A session is an environment in which tensors are evaluated.
  2. We need to read and set up our neural network by loading it from the file.
  3. Next, we need to ask for our image in the format that'll be readable by the neural network.
  4. We will need to run a power model and receive a list of row predictions, and transform these predictions into actual label values, as shown in the following code:
SESSION = tf.InteractiveSession()softmax_tensor = tf.get_default_graph().get_tensor_by_name('softmax:0')predictions = SESSION.run(softmax_tensor,{'DecodeJpeg/contents:0': image_data})node_loolup.id_to_string(predictions) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required