Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Deep Learning for Computer Vision

You're reading from  Deep Learning for Computer Vision

Product type Book
Published in Jan 2018
Publisher Packt
ISBN-13 9781788295628
Pages 310 pages
Edition 1st Edition
Languages
Author (1):
Rajalingappaa Shanmugamani Rajalingappaa Shanmugamani
Profile icon Rajalingappaa Shanmugamani

Table of Contents (17) Chapters

Title Page
Copyright and Credits
Packt Upsell
Foreword
Contributors
Preface
1. Getting Started 2. Image Classification 3. Image Retrieval 4. Object Detection 5. Semantic Segmentation 6. Similarity Learning 7. Image Captioning 8. Generative Models 9. Video Classification 10. Deployment 1. Other Books You May Enjoy

Model inference


Any new data can be passed to the model to get the results. This process of getting the classification results or features from an image is termed as inference. Training and inference usually happen on different computers and at different times. We will learn about storing the model, running the inference, and using TensorFlow Serving as the server with good latency and throughput.

Exporting a model

The model after training has to be exported and saved. The weights, biases, and the graph are stored for inference. We will train an MNIST model and store it. Start with defining the constants that are required, using the following code:

work_dir = '/tmp'
model_version = 9
training_iteration = 1000
input_size = 784
no_classes = 10
batch_size = 100
total_batches = 200

The model_version can be an integer to specify which model we want to export for serving. The feature config is stored as a dictionary with placeholder names and their corresponding datatype. The prediction classes and...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}