Skip to content

Commit 412efe6

Browse files
committed
filenotfound error
1 parent b15584d commit 412efe6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cortex/_lib/exp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ def strip_Nones(d):
9696

9797
file_path = path.join(binary_dir, '{}.t7'.format(filename))
9898
if prefix == 'last':
99-
copyfile(file_path, file_path + '.bak')
99+
try:
100+
copyfile(file_path, file_path + '.bak')
101+
except FileNotFoundError:
102+
pass
100103

101104
logger.info('Saving checkpoint {}'.format(file_path))
102105
torch.save(state, file_path)

0 commit comments

Comments
 (0)