Training and freezing an image captioning model
In this section, we'll first summarize the process of training the Show and Tell model called im2txt, documented at https://github.com/tensorflow/models/tree/master/research/im2txt, with some tips to help you better understand the process. Then we'll show some key changes to the Python code that comes with the im2txt model project, in order to freeze the model to be ready for use on mobile devices.
Training and testing caption generation
If you have followed the Setting up the TensorFlow Object Detection API section in Chapter 3, Detecting Objects and Their Locations, then you already have the im2txt
folder installed; otherwise simplycd
to your TensorFlow source root directory then run:
git clone https://github.com/tensorflow/models
One Python library you probably haven't installed is the Natural Language ToolKit (NLTK) , one of the most popular Python libraries for natural language processing. Just go to its website at http://www.nltk.org for...