I am trying to learn how to retrain an image classifier using transfer learning. I am following the steps shown in this tutorial.
I successfully retrained the model but I come across problems in the last step where he writes python script for classifying the newly trained model. In the video, he starts writing the code at 4:18 but does not specify where. I try writing it in the docker container but it gives me the no module named platform
error and the NameError: name 'sys' is not defined
error. I try writing it locally in my machine and get errors as well since I do not have the dependencies installed locally. I am not sure where to write the python code for the final step in the tutorial. Any help is appreciated.
Terminal code and errors:
root@dbe57bdfb014:/tensorflow# python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf, sys
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "tensorflow/python/pywrap_tensorflow.py", line 25, in <module>
from tensorflow.python.platform import self_check
ImportError: No module named platform
>>> image_path = sys.argv[1]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'sys' is not defined