Skip to content

Instantly share code, notes, and snippets.

@ven-kyoshiro
Created August 30, 2018 02:43
Show Gist options
  • Save ven-kyoshiro/7ea3a723ea2211dfc450060f563bc2ff to your computer and use it in GitHub Desktop.
Save ven-kyoshiro/7ea3a723ea2211dfc450060f563bc2ff to your computer and use it in GitHub Desktop.
gym_classic_error_in_server
import chainer
import chainer.functions as F
import chainer.links as L
import chainerrl
import gym
import numpy as np
# 描画用
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from IPython import display
def show_state(env, step=0, info=""):
plt.figure(3)
plt.clf()
plt.imshow(env.render(mode='rgb_array'))
plt.title("Step: %d %s" % (step, info))
plt.axis('off')
env = gym.make('Acrobot-v1')
print('observation space:', env.observation_space)
print('action space:', env.action_space)
obs = env.reset()
show_state(env, step=0, info="")
print('initial observation:', obs)
action = env.action_space.sample()
obs, r, done, info = env.step(action)
print('next observation:', obs)
print('reward:', r)
print('done:', done)
print('info:', info)
@ven-kyoshiro
Copy link
Author

case3 is fetal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment