Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Including code for training from checkpoint#61

Open
imjohnzakkam wants to merge 3 commits into
sthalles:mastersthalles/SimCLR:masterfrom
imjohnzakkam:masterimjohnzakkam/SimCLR:masterCopy head branch name to clipboard
Open

Including code for training from checkpoint#61
imjohnzakkam wants to merge 3 commits into
sthalles:mastersthalles/SimCLR:masterfrom
imjohnzakkam:masterimjohnzakkam/SimCLR:masterCopy head branch name to clipboard

Conversation

@imjohnzakkam

Copy link
Copy Markdown

Updated the simclr.py file with including code for loading from checkpoints and other minor changes

@Yadino

Yadino commented Dec 11, 2023

Copy link
Copy Markdown

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.