SimCLR
SimCLR copied to clipboard
Including code for training from checkpoint
Updated the simclr.py file with including code for loading from checkpoints and other minor changes
in load_checkpoint you start by doing a check
if(os.path.exists(filepath)):
Yet you try to catch an exception when you call this function in simclr.py. It will not throw an exception because of this check, but rather fail quietly.
Better do something like
def load_checkpoint(model, filepath): try: assert os.path.exists(filepath) ckpt = torch.load(filepath) model.load_state_dict(ckpt['state_dict']) epoch = ckpt['epoch'] return model, epoch except Exception: raise InvalidCheckpointPath()