Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pfrl_pdddqn
minerl_pdddqn_baseline
Commits
32342ba6
Commit
32342ba6
authored
Aug 14, 2020
by
avinash_ummadisingu
Browse files
Fix unexpected behavior of env_wrapper
parent
ab9359cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
mod/env_wrappers.py
View file @
32342ba6
...
...
@@ -22,7 +22,9 @@ def wrap_env(
randomize_action
,
eval_epsilon
,
action_choices
):
# wrap env: time limit...
if
isinstance
(
env
,
gym
.
wrappers
.
TimeLimit
):
# Don't use `ContinuingTimeLimit` for testing, in order to avoid unexpected behavior on submissions.
# (Submission utility regards "done" as an episode end, which will result in endless evaluation)
if
not
test
and
isinstance
(
env
,
gym
.
wrappers
.
TimeLimit
):
logger
.
info
(
'Detected `gym.wrappers.TimeLimit`! Unwrap it and re-wrap our own time limit.'
)
env
=
env
.
env
max_episode_steps
=
env
.
spec
.
max_episode_steps
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment