neurips2020-procgen-starter-kit
neurips2020-procgen-starter-kit copied to clipboard
Unable to set seed explicitly
If I append the following code to the end of envs.procgen_env_wrapper.py and run the file, I'll receive error:
TypeError: seed() takes 1 positional argument but 2 were given
code:
if __name__ == "__main__":
env = ProcgenEnvWrapper({})
env.seed(0)
Did you try passing rand_seed in the env_config?
Refer: https://github.com/openai/procgen/blob/master/procgen/env.py#L77
Hi, @jyotishp. No, I did not. I used the wrapper from env. procgen_env_wrapper.py, which did not pass rand_seed. After you mentioned that, I also tried to add "rand_seed=0" to self._default_config. The same error occurred, which said seedfunction only acceptedself` argument -- I also verified it with the following code
def seed(self, seed=None):
import inspect
print(inspect.signature(self.env.seed))# print ()
return self.env.seed(seed)
Currently I just omit seed, but this will give me a warning:
Warning: seed ignored.
Could you provide a exemplary code that works?
So how we conduct repeat experiments with different seed? In my practice, I am using ray.tune's argument num_samples=3 but I think a better way is to explicit specify the seed, rather than setting config["seed"] = None.