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

Fix gSDE loading issue in test mode #45

Merged
merged 4 commits into from
Jun 8, 2020
Merged

Fix gSDE loading issue in test mode #45

merged 4 commits into from
Jun 8, 2020

Conversation

araffin
Copy link
Member

@araffin araffin commented Jun 4, 2020

Description

closes #44

related to DLR-RM/rl-baselines3-zoo#18

unfortunately, we cannot test that :/ (maybe we should add some loading/saving tests on cpu/gpu at some point, when available)

Motivation and Context

  • 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 checked the codestyle using make lint
  • I have ensured make pytest and make type both pass.

Copy link
Collaborator

@AdamGleave AdamGleave 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 the SDE codebase well enough to know what caused the bug without some further digging so probably not the best person to review this. Seems OK apart from one nit though.

:param batch_size: (int)
"""
assert isinstance(self.actor.action_dist, StateDependentNoiseDistribution), \
'reset_noise() is only available when using gSDE'
Copy link
Collaborator

Choose a reason for hiding this comment

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

I try and avoid \ in Python; maybe msg = ... and then assert cond, msg?

@araffin araffin merged commit 11d33eb into master Jun 8, 2020
@araffin araffin deleted the fix/sde-cuda branch June 8, 2020 09:15
Shunian-Chen pushed a commit to Shunian-Chen/AIPI530 that referenced this pull request Nov 14, 2021
* removed policy from save, changed th.loads to map to device

* found hack: catch pickle exception and trying th.load with mapping instead, otherwise raise exception with more information -> loading cuda on cpu raises exception -> leads to th.load with map being called

* deleted todo

* updated changelog

* start of saving refactor

* first working c

* all tests pass, save refactored

* - backwards compatibilty not always
- make pytest all passing
- make typing all passing

* Fixes and simplify the save method

* Remove unused param

* Fix backward compat

* Fix docstring
@araffin araffin mentioned this pull request Jul 5, 2024
5 tasks
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.

PPO + gSDE trained on GPU thow an error at test time with deterministic=True
2 participants