Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Intelligent Mobile Projects with TensorFlow

You're reading from   Intelligent Mobile Projects with TensorFlow Build 10+ Artificial Intelligence apps using TensorFlow Mobile and Lite for iOS, Android, and Raspberry Pi

Arrow left icon
Product type Paperback
Published in May 2018
Publisher Packt
ISBN-13 9781788834544
Length 404 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
 Tang Tang
Author Profile Icon Tang
Tang
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Title Page
Copyright and Credits
Dedication
Packt Upsell
Foreword
Contributors
Preface
1. Getting Started with Mobile TensorFlow 2. Classifying Images with Transfer Learning FREE CHAPTER 3. Detecting Objects and Their Locations 4. Transforming Pictures with Amazing Art Styles 5. Understanding Simple Speech Commands 6. Describing Images in Natural Language 7. Recognizing Drawing with CNN and LSTM 8. Predicting Stock Price with RNN 9. Generating and Enhancing Images with GAN 10. Building an AlphaZero-like Mobile Game App 11. Using TensorFlow Lite and Core ML on Mobile 12. Developing TensorFlow Apps on Raspberry Pi 1. Other Books You May Enjoy Index

Transforming and optimizing the image captioning model


If you really can't wait any longer and decide to try the freshly frozen hot model on your iOS or Android app now, you certainly can, but you'll be shown a fatal error, No OpKernel was registered to support Op 'DecodeJpeg' with these attrs, to force you to reconsider your decision.

Fixing errors with transformed models

Normally, you can use a tool called strip_unused.py, located at the same location as freeze_graph.py at tensorflow/python/tools, to remove the DecodeJpeg operation that is not included in the TensorFlow core library (see https://www.tensorflow.org/mobile/prepare_models#removing_training-only_nodes for more details), but since the input node image_feed requires the decode operation (Figure 6.2), a tool such as strip_unused won't treat the DecodeJpeg as unused so it won't be stripped. You can verify this by first running the strip_unused command as follows:

bazel-bin/tensorflow/python/tools/strip_unused --input_graph=/tmp/image2text_frozen...
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 £13.99/month. Cancel anytime
Visually different images