Kautenja / nes-py

A Python3 NES emulator and OpenAI Gym interface
MIT License
235 stars 63 forks source link

env.reset() returns TypeError: JoypadSpace.reset() got an unexpected keyword argument 'seed' error while using DummyVecEnv wrapper #96

Open rohitsaikrishnan opened 9 months ago

rohitsaikrishnan commented 9 months ago

Describe the bug

A clear and concise description of what the bug is. I am facing this error TypeError: JoypadSpace.reset() got an unexpected keyword argument 'seed' when using DummyVecEnv and env.reset() after vectorization. can anyone please help

Similar to the error here: https://stackoverflow.com/questions/76509663/typeerror-joypadspace-reset-got-an-unexpected-keyword-argument-seed-when-i https://github.com/openai/gym/issues/2531#issuecomment-1868421314

To Reproduce

Steps to reproduce the behavior: !pip install nes-py !pip install gym-super-mario-bros !pip install stable-baselines3[extra] import gym_super_mario_bros from gym_super_mario_bros.actions import SIMPLE_MOVEMENT from nes_py.wrappers import JoypadSpace from gym.wrappers import GrayScaleObservation, FrameStack from gym.wrappers import ResizeObservation

Import Vectorization wrappers

from stable_baselines3.common.vec_env import VecFrameStack, DummyVecEnv env = gym_super_mario_bros.make('SuperMarioBros-v0') env = JoypadSpace(env, SIMPLE_MOVEMENT) env = GrayScaleObservation(env, keep_dim=True) env = DummyVecEnv([lambda: env]) env = VecFrameStack(env, 4, channels_order='last') state = env.reset()

Expected behavior

A clear and concise description of what you expected to happen. should return start state of mario game environment with 4 stacked frames

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

Additional context

Add any other context about the problem here.