Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/4156 filter hparams for yaml - fsspec #4158

Merged
merged 5 commits into from Oct 15, 2020
Merged

Conversation

Borda
Copy link
Member

@Borda Borda commented Oct 14, 2020

What does this PR do?

Fixes #4156
BTW, this is needed for unblocking Bolts

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 馃檭

@Borda Borda added the bug Something isn't working label Oct 14, 2020
@Borda Borda added this to the 1.0.x milestone Oct 14, 2020
@mergify mergify bot requested a review from a team October 14, 2020 23:27
@Borda Borda marked this pull request as draft October 14, 2020 23:30
Copy link
Contributor

@teddykoker teddykoker left a comment

Choose a reason for hiding this comment

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

Nice! Does this mean we could do self.save_hyperparameters() by default now?

@Borda Borda marked this pull request as ready for review October 14, 2020 23:45
@Borda Borda added the priority: 0 High priority task label Oct 14, 2020
@codecov
Copy link

codecov bot commented Oct 15, 2020

Codecov Report

Merging #4158 into master will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #4158   +/-   ##
======================================
  Coverage      93%     93%           
======================================
  Files         103     103           
  Lines        7805    7813    +8     
======================================
+ Hits         7239    7247    +8     
  Misses        566     566           

@mergify mergify bot requested a review from a team October 15, 2020 06:53
Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

Great PR ! Would you mind adding support for numpy array and tensors conversion to list ?

pytorch_lightning/core/saving.py Show resolved Hide resolved
hparams_allowed = {}
# drop paramaters which contain some strange datatypes as fsspec
for k, v in hparams.items():
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @Borda, I was wondering if it makes sense to force dumping to yaml file. It might break reproducibility for some use cases. But for the yaml format, we could also support some conversion like: tensor and numpy array to list, etc...

Copy link
Member Author

Choose a reason for hiding this comment

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

so how else would you test that some value/data are not possible to dum, I have not found any method like is_dumpable and most examples use this construct...

tests/models/test_hparams.py Show resolved Hide resolved
@mergify
Copy link
Contributor

mergify bot commented Oct 15, 2020

This pull request is now in conflict... :(

Borda and others added 5 commits October 15, 2020 14:41
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
@Borda Borda merged commit 4204ef7 into master Oct 15, 2020
@Borda Borda deleted the bugfix/4156_yaml-fsspec branch October 15, 2020 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: 0 High priority task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crashing dump for hparams containing fsspec
5 participants