Skip to content

Commit

Permalink
Explicit directory when saving
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonHanx committed Dec 31, 2020
1 parent ab1e43f commit 629e9ed
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions encoding/utils/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@

__all__ = ['save_checkpoint', 'download', 'mkdir', 'check_sha1']

def save_checkpoint(state, args, is_best, filename='checkpoint.pth.tar'):
def save_checkpoint(state, directory, is_best, filename='checkpoint.pth.tar'):
"""Saves checkpoint to disk"""
if hasattr(args, 'backbone'):
directory = "runs/%s/%s/%s/%s/"%(args.dataset, args.model, args.backbone, args.checkname)
else:
directory = "runs/%s/%s/%s/"%(args.dataset, args.model, args.checkname)
if not os.path.exists(directory):
os.makedirs(directory)
filename = directory + filename
Expand Down

0 comments on commit 629e9ed

Please sign in to comment.