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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(v3.5.2) SB3 Logger bug fix with wandb #429

Merged
merged 4 commits into from
Aug 29, 2024
Merged

Conversation

AlejandroCN7
Copy link
Member

Description

Fixes a minor issue with the SB3 logger to record data in the same location as the WandB session for our environments.

Motivation and Context

In algorithms like PPO, there is no problem since the step counter aligns with those of the environment. However, in other algorithms like SAC, some synchronization mismatches can occur between the algorithm's steps and the actual steps taken in the environment, which caused the data not to be logged in the latter case.

This PR fixes the issue by ensuring that logs to WandB made from the native SB3 logger do not cause an increment in the number of steps, and therefore in the X-axis of the graphs.

Why is this change required? What problem does it solve? Please, reference issue or issues opened previously.

Fixes #(issue or issues)

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)
  • Improvement (of an existing feature)
  • Others

Checklist:

  • I've read the CONTRIBUTION guide (required)
  • My change requires a change to the documentation.
  • I have updated the tests.
  • I have updated the documentation accordingly.
  • I have reformatted the code using autopep8 second level aggressive.
  • I have reformatted the code using isort.
  • I have ensured cd docs && make spelling && make html pass (required if documentation has been updated.)
  • I have ensured pytest tests/ -vv pass. (required).
  • I have ensured pytype -d import-error sinergym/ pass. (required)

Changelog:

  • Scripts: Train updated with traceback show (useful for wandb).
  • LoggerEvalCallback: Updated eval freq to avoid empty episodes in any environment.
  • Logger: Native SB3 logger updated for no specify step in wandb log.

@AlejandroCN7 AlejandroCN7 merged commit 616cb43 into main Aug 29, 2024
4 checks passed
@AlejandroCN7 AlejandroCN7 deleted the bug/fix-sb3-logger branch August 29, 2024 10:16
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.

1 participant