Skip to content

Upgrade to TF 1.12 #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion create_integ_test_docker_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import glob
import sys

TF_VERSION = "1.11.0"
TF_VERSION = "1.12.0"
REGION = "us-west-2"

if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def build_extension(self, ext):

setup(
name='sagemaker_tensorflow',
version='1.11.0.1.0.0',
version='1.12.0.1.0.0',
description='Amazon Sagemaker specific TensorFlow extensions.',
packages=find_packages(where='src', exclude=('test',)),
package_dir={'': 'src'},
Expand Down
4 changes: 4 additions & 0 deletions src/sagemaker_tensorflow/pipemode.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ def __init__(self, channel, record_format='RecordIO',
def _as_variant_tensor(self):
return self._tf_plugin.pipe_mode_dataset(self.benchmark, self.record_format, self.state_dir, self.channel,
self.pipe_dir)

def _inputs(self):
return []

def _validate_input_data_config(self):
if self.channel not in self.input_data_config:
raise PipeModeDatasetException("Channel {} not found in Training Job InputDataConfig".format(self.channel))
Expand Down
2 changes: 1 addition & 1 deletion test/integ/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ubuntu:16.04

ARG device=cpu
ARG tensorflow_version=1.9.0
ARG tensorflow_version=1.12.0
ARG script
ARG python

Expand Down
16 changes: 15 additions & 1 deletion test/integ/scripts/estimator_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
import tensorflow as tf
from sagemaker_tensorflow import PipeModeDataset

ds = PipeModeDataset("elizabeth")
print("Starting estimator script")

ds = PipeModeDataset("elizabeth")

class BenchmarkConfig(object):

Expand Down Expand Up @@ -74,24 +75,37 @@ def parse(record):
model_dir = tempfile.mkdtemp()
estimator = tf.estimator.LinearClassifier(feature_columns=[column])

print("About to call train")
estimator.train(input_fn=input_fn)

# Confirm that we have read the correct number of pipes
assert os.path.exists('/opt/ml/input/data/{}_{}'.format(config.channel, config.epochs + 1))

print("About to call evaluate")
result = estimator.evaluate(input_fn=input_fn)
for key,value in sorted(result.items()):
print('%s: %s' % (key, value))


# Test that we can create a new PipeModeDataset after training has run
print("Validate that new PipeModeDataset on existing channel can be created")

ds = PipeModeDataset(config.channel)

with tf.Session() as sess:
it = ds.make_one_shot_iterator()
next = it.get_next()
sess.run(next)

print("Validate create, read, discard, recreate")

# Test that we can create a PipeModeDataset, discard it, and read from a new one
ds = PipeModeDataset(config.channel)
with tf.Session() as sess:
it = ds.make_one_shot_iterator()
next = it.get_next()


ds = PipeModeDataset(config.channel)
with tf.Session() as sess:
it = ds.make_one_shot_iterator()
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ deps =
mock
contextlib2
teamcity-messages
tensorflow==1.11
tensorflow==1.12
awslogs
docker
cmake
Expand All @@ -60,5 +60,5 @@ deps =
cmake
flake8
flake8-future-import
tensorflow==1.11
tensorflow==1.12
commands = flake8