Skip to content

Conversation

@rclarsfull
Copy link

@rclarsfull rclarsfull commented Aug 28, 2025

Description

If no trail id ist given to load _trail() it, will load the best trail. When checking trai_id != None this disables this feature and makes it unusabel.

Motivation and Context

I just deletet the check, so its possile to just do this to train with the best taril.

python rl_zoo3/train.py \
  --algo ppo \
  --env MergeEnv-v2 \
  --storage sqlite:///logs/mergeenv_optuna.db \
  --study-name MergeEventOptimizev1 \
  -P 

Issue: #498

closes #498

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)

Checklist:

  • I've read the CONTRIBUTION guide (required)
  • I have updated the changelog accordingly (required).
  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • I have updated the documentation accordingly.
  • I have reformatted the code using make format (required)
  • I have checked the codestyle using make check-codestyle and make lint (required)
  • I have ensured make pytest and make type both pass. (required)

Note: we are using a maximum length of 127 characters per line

rclarsfull and others added 2 commits August 28, 2025 17:47
If no trail id ist given to load _trail() it, will load the best trail. When checking `trai_id != None` this disables this feature and makes it unusabel.


See https://github.com/DLR-RM/rl-baselines3-zoo/blob/master/CHANGELOG.md

Copy link
Member

Choose a reason for hiding this comment

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

see line just above

raise ValueError(f"Hyperparameters not found for {self.algo}-{self.env_name.gym_id} in {self.config}")

if self.storage and self.study_name and self.trial_id:
if self.storage and self.study_name:
Copy link
Member

Choose a reason for hiding this comment

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

I think this check is needed (see failures on CI), instead we could allow passing a special value like -1 to allow loading the best trial

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.

[Bug]: Cant start training with best optuna trail

2 participants