hardmaru / slimevolleygym

A simple OpenAI Gym environment for single and multi-agent reinforcement learning
Apache License 2.0
725 stars 111 forks source link

No attribute 'np_random'? #13

Closed pedrohpf closed 3 years ago

pedrohpf commented 3 years ago

I don't know if i'm doing something wrong, I load the env and then use the wrapper AtariPreprocessing

env = gym.make("SlimeVolleyNoFrameskip-v0") env = AtariPreprocessing(env)

But when running it gives out this error:

self.env.unwrapped.np_random.randint(1, self.noop_max + 1) 'SlimeVolleyAtariEnv' object has no attribute 'np_random'

It works when running a normal atari environment like "PongNoFrameskip-v0"

pedrohpf commented 3 years ago

Turns out I had to use something like env.seed(np.random.randint(0, 10000)) after creating environment. I then had another error with a function from "AtariPreprocessing" in here:

if self.grayscale_obs: self.ale.getScreenGrayscale(self.obs_buffer[0]) else: self.ale.getScreenRGB(self.obs_buffer[0])

It didn't find those functions from ale, so I just used many other wrappers that do the same as that single one (as shown in your examples).