1
0
mirror of https://github.com/gryf/coach.git synced 2025-12-17 19:20:19 +01:00

Don't download when checkpoint files are already present (#109)

* add check if checkpoint file present
This commit is contained in:
Cody Hsieh
2018-11-21 15:32:53 -08:00
committed by Balaji Subramaniam
parent b94239234a
commit dd18959e53

View File

@@ -110,7 +110,8 @@ class S3DataStore(DataStore):
objects = self.mc.list_objects_v2(self.params.bucket_name, prefix=rel_path, recursive=True)
for obj in objects:
filename = os.path.abspath(os.path.join(self.params.checkpoint_dir, obj.object_name))
self.mc.fget_object(obj.bucket_name, obj.object_name, filename)
if not os.path.exists(filename):
self.mc.fget_object(obj.bucket_name, obj.object_name, filename)
except ResponseError as e:
print("Got exception: %s\n while loading from S3", e)