Make sure the string returned is a string in Python 3 because of different string...
authorFrank Chen <frankchn@google.com>
Wed, 7 Mar 2018 16:33:46 +0000 (08:33 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 7 Mar 2018 16:37:57 +0000 (08:37 -0800)
PiperOrigin-RevId: 188180206

tensorflow/contrib/cluster_resolver/python/training/tpu_cluster_resolver.py

index 83d26a1..91874f9 100644 (file)
@@ -130,10 +130,11 @@ class TPUClusterResolver(ClusterResolver):
     should_resolve = self._shouldResolve()
 
     if not project and should_resolve:
-      project = self._requestComputeMetadata('project/project-id')
+      project = compat.as_str(
+          self._requestComputeMetadata('project/project-id'))
 
     if not zone and should_resolve:
-      zone_path = self._requestComputeMetadata('instance/zone')
+      zone_path = compat.as_str(self._requestComputeMetadata('instance/zone'))
       zone = zone_path.split('/')[-1]
 
     self._project = project