How do I use the model Inception.tgz in TensorFlow?
<p>I just downloaded the inception.tgz file from tensorflow.org at <a href="http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz" rel="nofollow">http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz</a>. But, I do not know where I should extract this. </p>

<p>Also, when I used the models/image/imagenet/classify_image.py script to get the model, the model was not saved after a reboot, so I had to download it again via the same script. I need to use it at times I am not connected to the Internet, so downloading the model everytime I need to classify is not ideal for me. How can I persist the model once and for all? </p>

<p>Also, how can I use the .tgz inception model?</p>

<p>I cannot make a comment to your Question since I do not have enough credits yet. So let me give you a generic answer.</p>

<ol>
<li><p>The <code>inception-2015-12-05.tgz</code> file you mentioned contains two files which you require:</p>

<p>a) imagenet_comp_graph_label_strings.txt</p>

<p>b) tensorflow_inception_graph.pb</p></li>
</ol>

<p>There is a license file that you won't require as well. These two files will let you make predictions on images.</p>

<ol start="2">
<li><p>The part where you mentioned <code>the model was not saved after a reboot, so I had to download it again via the same script</code> intrigues me. I have never come across such an issue. Try this now:</p>

<ul>
<li>Create a folder in a location of your choice. Say <code>~/Documents</code>.</li>
<li>When you run the python script <code>classify_image.py</code> use the <code>--model_dir</code> flag to redirect the model file directory to <code>~/Documents</code>. This will essentially download and extract the necessary files to the specified location and you can use the same location in <code>--model_dir</code> flag ever since.</li>
</ul></li>
</ol>

<p>Take a look at this:</p>

<pre><code>Aruns-MacBook-Pro:imagenet arundas$ python classify_image.py --model_dir ~/Documents/
&gt;&gt; Downloading inception-2015-12-05.tgz 100.0%
Succesfully downloaded inception-2015-12-05.tgz 88931400 bytes.
W tensorflow/core/framework/op_def_util.cc:332] Op BatchNormWithGlobalNormalization is deprecated. It will cease to work in GraphDef version 9. Use tf.nn.batch_normalization().
giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca (score = 0.89233)
indri, indris, Indri indri, Indri brevicaudatus (score = 0.00859)
lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens (score = 0.00264)
custard apple (score = 0.00141)
earthstar (score = 0.00107)

Aruns-MacBook-Pro:imagenet arundas$ python classify_image.py --model_dir ~/Documents/
W tensorflow/core/framework/op_def_util.cc:332] Op BatchNormWithGlobalNormalization is deprecated. It will cease to work in GraphDef version 9. Use tf.nn.batch_normalization().
giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca (score = 0.89233)
indri, indris, Indri indri, Indri brevicaudatus (score = 0.00859)
lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens (score = 0.00264)
custard apple (score = 0.00141)
earthstar (score = 0.00107)
</code></pre>

<p>The model was not downloaded the second time. 
Hope this helps.</p>

python tensorflow