fix handling CTRL C

This commit is contained in:
Eren Golge
2018-01-24 08:17:49 -08:00
parent 2a20b7c2ac
commit d95a2ce26f
3 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -34,8 +34,9 @@ def remove_experiment_folder(experiment_path):
checkpoint_files = glob.glob(experiment_path+"/*.pth.tar")
if len(checkpoint_files) < 1:
shutil.rmtree(experiment_path)
print(" ! Run is removed from {}".format(experiment_path))
if os.path.exists(experiment_path):
shutil.rmtree(experiment_path)
print(" ! Run is removed from {}".format(experiment_path))
else:
print(" ! Run is kept in {}".format(experiment_path))