In [1]:
from IPython.display import Image, display

import tensorflow as tf
import numpy as np
import os

In [2]:
# Functions and classes for loading and using the Inception model.
import inception

inception.data_dir = 'inception/'

#inception.maybe_download()

model = inception.Inception()


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-279e2163d659> in <module>()
      1 # Functions and classes for loading and using the Inception model.
----> 2 import inception
      3 
      4 inception.data_dir = 'inception/'
      5 

/home/ubuntu/tensorflow/inception/example/inception.py in <module>()
     44 import numpy as np
     45 import tensorflow as tf
---> 46 import download
     47 from cache import cache
     48 import os

/home/ubuntu/tensorflow/inception/example/download.py in <module>()
     17 import sys
     18 import os
---> 19 import urllib.request
     20 import tarfile
     21 import zipfile

ImportError: No module named request

In [ ]:
def classify(image_path):
    # Display the image.
    display(Image(image_path))

    # Use the Inception model to classify the image.
    pred = model.classify(image_path=image_path)

    # Print the scores and names for the top-10 predictions.
    model.print_scores(pred=pred, k=10, only_first_name=True)

In [ ]: