Commit 1464a721 authored by Amit Patankar's avatar Amit Patankar Committed by Neal Wu
Browse files

Official py3 testing. (#2499)

parent 5ddd7e55
......@@ -32,8 +32,8 @@ class BaseTest(tf.test.TestCase):
def test_dataset_input_fn(self):
fake_data = bytearray()
fake_data.append(7)
for i in xrange(3):
for _ in xrange(1024):
for i in range(3):
for _ in range(1024):
fake_data.append(i)
_, filename = mkstemp(dir=self.get_temp_dir())
......
......@@ -90,11 +90,11 @@ def filenames(is_training):
if is_training:
return [
os.path.join(FLAGS.data_dir, 'train-%05d-of-01024' % i)
for i in xrange(0, 1024)]
for i in range(0, 1024)]
else:
return [
os.path.join(FLAGS.data_dir, 'validation-%05d-of-00128' % i)
for i in xrange(0, 128)]
for i in range(0, 128)]
def dataset_parser(value, is_training):
......
......@@ -22,6 +22,9 @@
# --docker-image flag), the default latest tensorflow docker
# will be used.
#
# The script obeys the following required environment variables unless superceded by
# the docker image flag:
# PYTHON_VERSION: (PYTHON2 | PYTHON3)
# SETUP
......@@ -31,6 +34,16 @@ EXIT=0
# Get current directory path to mount
export WORKSPACE=${PWD}
if [ "$PYTHON_VERSION" = "PYTHON3" ]; then
DOCKER_IMG_NAME="tensorflow/tensorflow:1.3.0-py3"
else
DOCKER_IMG_NAME="tensorflow/tensorflow:1.3.0"
if [ "$PYTHON_VERSION" != "PYTHON2" ]; then
echo "WARNING: Python version was not specified. Using Python2 by default."
sleep 5
fi
fi
DOCKER_BINARY="docker"
# Decide docker image and tag
......@@ -38,9 +51,6 @@ if [[ "$1" == "--docker-image" ]]; then
DOCKER_IMG_NAME="$2"
echo "Using specified docker tensorflow image and tag: ${DOCKER_IMG_NAME}"
shift 2
else
DOCKER_IMG_NAME="tensorflow/tensorflow:1.3.0"
echo "Using the default docker tensorflow image and tag: ${DOCKER_IMG_NAME}"
fi
# Specify which test is to be run
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment