large-scale-curiosity icon indicating copy to clipboard operation
large-scale-curiosity copied to clipboard

" AttributeError: 'RetroEnv' object has no attribute 'em' " stuck with this error. need some assistance :)

Open harshdeepkukreja opened this issue 2 years ago • 1 comments

harshdeepkukreja avatar May 10 '22 06:05 harshdeepkukreja

I'm getting the same error on this code

# Reset game to starting state
obs = env.reset()
# Set flag to flase
done = False
for game in range(1): 
    while not done: 
        if done: 
            obs = env.reset()
        env.render()
        obs, reward, done, info = env.step(env.action_space.sample())
        time.sleep(0.01)
        print(reward)

env.close()
print(info)

you just have to start the env before with this code

# Starts up the game environment
env = retro.make(game='StreetFighterIISpecialChampionEdition-Genesis')

and remember that in retro we can only run one at a time for running multiple env check this out --> https://github.com/MaxStrange/retrowrapper

rambo1111 avatar Feb 04 '24 11:02 rambo1111