Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Commit 807cf8f

Browse files
authored
Merge pull request #719 from jjtan/patch-1
Decode bytes into string when getting cloud
2 parents 98fd684 + f7dd9b0 commit 807cf8f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tensor2tensor/utils/cloud_mlengine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def configure_job():
111111
training_input = {
112112
'pythonModule': 'tensor2tensor.bin.t2t_trainer',
113113
'args': flags_as_args(),
114-
'region': cloud.default_region(),
114+
'region': cloud.default_region().decode('utf-8'),
115115
'runtimeVersion': '1.5',
116116
'pythonVersion': '3.5' if sys.version_info.major == 3 else '2.7',
117117
'jobDir': FLAGS.output_dir,
@@ -138,7 +138,7 @@ def configure_job():
138138

139139
def launch_job(job_spec):
140140
"""Launch job on ML Engine."""
141-
project_id = 'projects/{}'.format(cloud.default_project())
141+
project_id = 'projects/{}'.format(cloud.default_project().decode('utf-8'))
142142
credentials = GoogleCredentials.get_application_default()
143143
cloudml = discovery.build('ml', 'v1', credentials=credentials,
144144
cache_discovery=False)
@@ -171,7 +171,7 @@ def tar_and_copy_t2t(train_dir):
171171
"""Tar Tensor2Tensor and cp to train_dir."""
172172
tf.logging.info('Tarring and pushing local Tensor2Tensor package.')
173173

174-
output = cloud.shell_output('pip show tensor2tensor').split('\n')
174+
output = cloud.shell_output('pip show tensor2tensor').decode('utf-8').split('\n')
175175
assert output[1].startswith('Version')
176176
assert output[7].startswith('Location')
177177
t2t_version = output[1].split(':')[1].strip()

0 commit comments

Comments
 (0)