Skip to content

Instantly share code, notes, and snippets.

@stobias123
Created June 29, 2020 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stobias123/4da70bbf6020eeec52ba1b7fc51fb123 to your computer and use it in GitHub Desktop.
Save stobias123/4da70bbf6020eeec52ba1b7fc51fb123 to your computer and use it in GitHub Desktop.
Tensorforce Problems
## tensorforce_agent.py
# 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__':
logger.set_level(logger.INFO)
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