Skip to content

Instantly share code, notes, and snippets.

Created June 29, 2020 02:45
What would you like to do?
Tensorforce Problems
# This code breaks immediately here with "Unknown Gym Environment"
env = gym.make("my_gm:level-v0")
environment = Environment.create(environment='gym', level=env, max_episode_timesteps=1000)
## it works fine as shown int his file. :/
class RandomAgent(object):
"""The world's simplest agent!"""
def __init__(self, action_space):
self.action_space = action_space
def act(self, observation, reward, done):
return self.action_space.sample()
if __name__ == '__main__':
env = gym.make("my_gym:level-v0")
outdir = '/tmp/random-agent-results'
env = wrappers.Monitor(env, directory=outdir, force=True)
agent = RandomAgent(env.action_space)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment