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

Update experience_source.py #749 Bug Fix #751

Merged
merged 5 commits into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed FP16 support with vision GPT model ([#694](https://github.com/PyTorchLightning/lightning-bolts/pull/694))
- Removing bias from linear model regularisation ([#669](https://github.com/PyTorchLightning/lightning-bolts/pull/669))
- Fixed CPC module issue ([#680](https://github.com/PyTorchLightning/lightning-bolts/pull/680))
- Fix doctest fails with ImportError: cannot import name 'Env' from 'gym' ([#751](https://github.com/PyTorchLightning/lightning-bolts/pull/751))


## [0.3.4] - 2021-06-17
Expand Down
10 changes: 7 additions & 3 deletions pl_bolts/datamodules/experience_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
from pl_bolts.utils import _GYM_AVAILABLE
from pl_bolts.utils.warnings import warn_missing_pkg

if _GYM_AVAILABLE:
from gym import Env
else: # pragma: no cover
try:
if _GYM_AVAILABLE:
from gym import Env
else: # pragma: no cover
warn_missing_pkg("gym")
Env = object
except:
warn_missing_pkg("gym")
Env = object

Expand Down