I'm learning python code for Deep Learning related things called TensorFlow. https://www.tensorflow.org/versions/master/tutorials/mnist/tf/index.html#tensorflow-mechanics-101
About the following description in that fully_connected_feed.py
from six.moves import xrange # pylint: disable=redefined-builtin
http://hhsprings.bitbucket.org/docs/translations/python/six-doc-ja/
Six provides a simple utility to absorb the differences between Python 2 and Python 3.
There is a correspondence table at the bottom of the same page.
Six names | Python 2 people | Python 3 people |
---|---|---|
... | ... | ... |
range | xrange() | range |
... | ... | ... |
Six names will make it easier to support Python3.
However, in fully_connected_feed.py, it is described by Python2 name as follows, so it must be rewritten after all when supporting Python3.
# Start the training loop.
for step in xrange(FLAGS.max_steps):
You can also try the following, and Precision is the same.
# Start the training loop.
for step in range(FLAGS.max_steps):
In the original fully_connected_feed.py, commenting out the following does not cause any problems, so I feel that Six is not used after all.
from six.moves import xrange # pylint: disable=redefined-builtin
Recommended Posts