Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

Issue 880#1028

Merged
sdesrozis merged 6 commits intopytorch:masterfrom
vfdev-5:issue-880
May 11, 2020
Merged

Issue 880#1028
sdesrozis merged 6 commits intopytorch:masterfrom
vfdev-5:issue-880

Conversation

@vfdev-5
Copy link
Collaborator

@vfdev-5 vfdev-5 commented May 10, 2020

Fixes #880

Description:

  • engine.state is created at engine init

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

@vfdev-5 vfdev-5 requested a review from sdesrozis May 10, 2020 22:15
Copy link
Contributor

@sdesrozis sdesrozis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand yet why lr_finder implies to save trainer but it's a detail :)

# restore to_save and reset trainer's state
obj = torch.load(cache_filepath.as_posix())
trainer.state = None
trainer.load_state_dict(obj["trainer"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it conflict with others loads ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it conflict with others loads ?

Which others loads ?
I didn't include trainer's state dict into to_save in order to keep it immutable as Mapping requires...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lr_finder just needs to restore state of trainer, that was a stupid remark !

@vfdev-5
Copy link
Collaborator Author

vfdev-5 commented May 11, 2020

I don't understand yet why lr_finder implies to save trainer but it's a detail :)

because when lr finder is run, engine is run too. Thus we need to come back to the initial state.

@sdesrozis sdesrozis merged commit 33519ac into pytorch:master May 11, 2020
@vfdev-5 vfdev-5 deleted the issue-880 branch May 15, 2020 21:15
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.

Initialize engine.state before calling run

2 participants