openai / procgen

Procgen Benchmark: Procedurally-Generated Game-Like Gym-Environments

Home Page:https://openai.com/blog/procgen-benchmark/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

invalid render mode human can not render"human" and "rgb_array"

xiezhipeng-git opened this issue · comments

invalid render mode human
File "C:\Users\hasee\AppData\Local\Programs\Python\python-3.9.13\Lib\site-packages\procgen\env.py", line 105, in init
raise Exception(f"invalid render mode {render_mode}")
File "C:\Users\hasee\AppData\Local\Programs\Python\python-3.9.13\Lib\site-packages\procgen\env.py", line 246, in init
super().init(num, env_name, options, **kwargs)
File "C:\Users\hasee\AppData\Local\Programs\Python\python-3.9.13\Lib\site-packages\procgen\env.py", line 265, in ProcgenEnv
return ToBaselinesVecEnv(ProcgenGym3Env(num=num_envs, env_name=env_name, **kwargs))

Name: procgen
Version: 0.10.7
Summary: Procedurally Generated Game-Like RL Environments
Home-page: https://github.com/openai/procgen
Author: OpenAI
Author-email:

Name: gym3
Version: 0.3.3
Summary: Vectorized Reinforcement Learning Environment Interface
Home-page: https://github.com/openai/gym3
Author: OpenAI
Name: gym
Version: 0.26.2
Summary: Gym: A universal API for reinforcement learning environments
Home-page: https://www.gymlibrary.dev/
Author: Gym Community
Author-email: jkterry@umd.edu
License: MIT

use human it has error and use rgb_array it is no render
and self.env.render() two model also same

It seems the rendered image is pushed into the info dict.

if (render_human) {
struct libenv_tensortype s;
strcpy(s.name, "rgb");
s.scalar_type = LIBENV_SCALAR_TYPE_DISCRETE;
s.dtype = LIBENV_DTYPE_UINT8;
s.shape[0] = RENDER_RES;
s.shape[1] = RENDER_RES;
s.shape[2] = 3;
s.ndim = 3,
s.low.uint8 = 0;
s.high.uint8 = 255;
info_types.push_back(s);
}

So it can be accessed by env.get_info()