Skip to content

Commit

Permalink
Update gymnasium dependency and render_mode in gym.make (#806)
Browse files Browse the repository at this point in the history
* Update gymnasium version and render mode in eval policy

* Fix error
  • Loading branch information
taufeeque9 committed Oct 8, 2023
1 parent e6d8886 commit aca4c07
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def get_local_version(version: "ScmVersion", time_format="%Y%m%d") -> str:
# encode only known incompatibilities here. This prevents nasty dependency issues
# for our users.
install_requires=[
"gymnasium[classic-control]~=0.28.1",
"gymnasium[classic-control]~=0.29",
"matplotlib",
"numpy>=1.15",
"torch>=1.4.0",
Expand Down Expand Up @@ -220,7 +220,7 @@ def get_local_version(version: "ScmVersion", time_format="%Y%m%d") -> str:
"docs": DOCS_REQUIRE,
"parallel": PARALLEL_REQUIRE,
"mujoco": [
"gymnasium[classic-control,mujoco]~=0.28.1",
"gymnasium[classic-control,mujoco]~=0.29",
],
"atari": ATARI_REQUIRE,
},
Expand Down
6 changes: 5 additions & 1 deletion src/imitation/scripts/eval_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ def eval_policy(
log_dir = logging_ingredient.make_log_dir()
sample_until = rollout.make_sample_until(eval_n_timesteps, eval_n_episodes)
post_wrappers = [video_wrapper_factory(log_dir, **video_kwargs)] if videos else None
with environment.make_venv(post_wrappers=post_wrappers) as venv:
render_mode = "rgb_array" if videos else None
with environment.make_venv(
post_wrappers=post_wrappers,
env_make_kwargs=dict(render_mode=render_mode),
) as venv:
if render:
venv = InteractiveRender(venv, render_fps)

Expand Down

0 comments on commit aca4c07

Please sign in to comment.