Skip to content

Update PyTorch Checkpoint Example using tempfile#313

Merged
gen740 merged 4 commits intooptuna:mainfrom
ParagEkbote:Fix-PyTorch-Example
Apr 15, 2025
Merged

Update PyTorch Checkpoint Example using tempfile#313
gen740 merged 4 commits intooptuna:mainfrom
ParagEkbote:Fix-PyTorch-Example

Conversation

@ParagEkbote
Copy link
Copy Markdown
Contributor

@ParagEkbote ParagEkbote commented Apr 12, 2025

Fixes #299

I've updated the example to use the tempfile module instead of using temporary files. The following output is seen:

Study statistics:
Number of finished trials: 20
Number of pruned trials: 7
Number of complete trials: 13
Best trial:
Value: 0.82890625
Params:
n_layers: 1
n_units_l0: 73
dropout_l0: 0.27826526915707817
optimizer: Adam
lr: 0.0033209042919099627

Could you please review?

cc: @not522

@c-bata
Copy link
Copy Markdown
Member

c-bata commented Apr 14, 2025

@gen740 Could you review this PR?

@c-bata c-bata added the enhancement Change that does not break compatibility and not affect public interfaces, but improves performance label Apr 14, 2025
Copy link
Copy Markdown
Member

@gen740 gen740 left a comment

Choose a reason for hiding this comment

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

I confirmed that it worked successfully in my environment.
LGTM!

@gen740 gen740 added this to the v4.4.0 milestone Apr 15, 2025
@gen740 gen740 merged commit 54e6318 into optuna:main Apr 15, 2025
6 checks passed
@ParagEkbote ParagEkbote deleted the Fix-PyTorch-Example branch April 15, 2025 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Change that does not break compatibility and not affect public interfaces, but improves performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using tempfile in PyTorch checkpoint example

3 participants