O'Reilly logo

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

Hands-On Serverless Deep Learning with TensorFlow and AWS Lambda

Book Description

Use the serverless computing approach to save time and money

Key Features

  • Save your time by deploying deep learning models with ease using the AWS serverless infrastructure
  • Get a solid grip on AWS services and use them with TensorFlow for efficient deep learning
  • Includes tips, tricks and best practices on serverless deep learning that you can use in a production environment

Book Description

One of the main problems with deep learning models is finding the right way to deploy them within the company's IT infrastructure. Serverless architecture changes the rules of the game—instead of thinking about cluster management, scalability, and query processing, it allows us to focus specifically on training the model. This book prepares you to use your own custom-trained models with AWS Lambda to achieve a simplified serverless computing approach without spending much time and money. You will use AWS Services to deploy TensorFlow models without spending hours training and deploying them. You'll learn to deploy with serverless infrastructures, create APIs, process pipelines, and more with the tips included in this book.

By the end of the book, you will have implemented your own project that demonstrates how to use AWS Lambda effectively so as to serve your TensorFlow models in the best possible way.

What you will learn

  • Gain practical experience by working hands-on with serverless infrastructures (AWS Lambda)
  • Export and deploy deep learning models using Tensorflow
  • Build a solid base in AWS and its various functions
  • Create a deep learning API using AWS Lambda
  • Look at the AWS API gateway
  • Create deep learning processing pipelines using AWS functions
  • Create deep learning production pipelines using AWS Lambda and AWS Step Function

Who this book is for

This book will benefit data scientists who want to learn how to deploy models easily and beginners who want to learn about deploying into the cloud. No prior knowledge of TensorFlow or AWS is required.

Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Hands-On Serverless Deep Learning with TensorFlow and AWS Lambda
  3. About Packt
    1. Why subscribe?
    2. Packt.com
  4. Contributors
    1. About the author
    2. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. Beginning with Serverless Computing and AWS Lambda
    1. What is serverless computing?
      1. Why serverless deep learning?
      2. Where serverless deep learning works and where it doesn't work?
        1. Where serverless deep learning works?
        2. Where serverless deep learning doesn't work?
    2. Lambda function – AWS implementation of FaaS
      1. Lambda triggers
      2. Why deep learning on AWS Lambda?
    3. Traditional versus Serverless architecture using Lambda
    4. Sample projects
      1. Deep learning API
      2. Deep learning batch processing
      3. Serverless deep learning workflow
    5. Summary
  7. Starting Deployment with AWS Lambda Functions
    1. Technical Requirements
    2. AWS Lambda functions
      1. Pros, cons, and limitations of AWS Lambda
    3. Getting started with AWS account
      1. AWS Free Tier
      2. Identity and Access Management (IAM)
    4. Creating a Hello World AWS Lambda function
      1. Using the Lambda function
      2. AWS Lambda code
    5. Introduction to the serverless framework
      1. Features of the serverless framework
    6. Installation of the serverless framework
    7. Deploying AWS Lambda functions using the serverless framework
      1. Configuration file
      2. Deployment process
    8. Summary
  8. Deploying TensorFlow Models
    1. Technical Requirements
    2. Approaches for building algorithms
    3. Why neural networks?
      1. Pre-trained networks
      2. Simple TensorFlow example
      3. Training for MNIST
    4. Repositories for pre-trained TensorFlow models
      1. TensorFlow repository
      2. TensorFlow Hub
      3. GitHub
    5. Image captioning example
      1. Inception v3
        1. TensorFlow code for Inception v3
        2. Running the code
    6. Summary
  9. Working with TensorFlow on AWS Lambda
    1. Technical Requirements
    2. Architecture of the deploying TensorFlow with AWS Lambda
      1. Model within the deployment package
        1. Pros
        2. Cons
      2. Model on the S3 bucket
        1. Pros
        2. Cons
      3. Model on the HTTP/FTP server
        1. Pros
        2. Cons
    3. General issues with deploying Python frameworks on AWS Lambda
      1. Solutions for issues with deploying Python frameworks on AWS Lambda
    4. Deploying TensorFlow on AWS Lambda using the pre-existing pack
    5. Deploying TensorFlow using a serverless framework
      1. Creating a bucket
        1. Index.py
        2. Serverless.yml
    6. Summary
  10. Creating the Deep Learning API
    1. Technical Requirements
    2. RESTful API
    3. AWS API Gateway
      1. Features
      2. Pricing
    4. Creating the API Gateway
      1. Creating an AWS Lambda instance
    5. Creating the API Gateway using the serverless framework
      1. Deploying the serverless framework
    6. Creating a first API project
    7. Summary
  11. Creating a Deep Learning Pipeline
    1. Technical Requirements
    2. Message queue
    3. Introduction to AWS SQS
      1. AWS API gateway features
      2. AWS SQS pricing
    4. Creating an AWS SQS connection using an AWS Console
      1. Creating an AWS Lambda instance
    5. Creating an AWS SQS connection using the serverless framework
      1. The Python file
      2. Code
        1. serverless.yml
        2. index.py
    6. Example project – deep learning pipeline
      1. Code
        1. Configuration file - serverless.yml
        2. index.py
    7. Summary
  12. Creating a Deep Learning Workflow
    1. Technical requirements
    2. Introduction to the AWS Step Functions service
      1. Processing workflow 
      2. AWS Step Functions
        1. AWS step function features 
        2. AWS Step Functions pricing 
        3. Step functions versus SQS
    3. Creating an AWS Step Functions connection to AWS Lambda using the AWS Console
      1. Creating the AWS Lambda instance
      2. Creating the step function
    4. Creating AWS step functions for an AWS Lambda instance using the serverless framework
      1. Step functions
      2. Serverless deployment
    5. Example project – deep learning workflow
      1. Creating the model
    6. Summary
  13. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think