Hi! I'm a student at the California Institute of Technology with a focus in Computer Science & Electrical Engineering. Feel free to visit my website and explore my various projects!
Select any of these to teleport to that page!
Render OpenAI Gym environments in Google Colaboratory
Home Page: https://pypi.org/project/colabgymrender/
License: MIT License
Hi! I'm a student at the California Institute of Technology with a focus in Computer Science & Electrical Engineering. Feel free to visit my website and explore my various projects!
Select any of these to teleport to that page!
Gym 1.0, according to the developers' roadmap, will introduce a number of breaking changes and deprecations that will necessitate appropriate changes to colabgymrender
. The ones of concern are mainly:
render
API requires render mode to be provided at environment initialization, rather than on step()
step
API will soon return 5 outputs, that is, observation, reward, terminal, truncation, info
reset
will always return info
now, in addition to observation
As of right now, the plan for colabgymrender
is to play along with these new changes by incrementing the major version of this package to avoid any strange surprises. We'll probably introduce colabgymrender==2.0.0
around the same time gym introduces its first major version.
I have created a new branch gym-1.0
. All pull requests targeted at resolving recent breaking changes in gym
will be referred to this branch. Once gym
version 1.0 is released, this branch will be merged with the base. See #8 and #9.
Feel free to discuss your opinion on this roadmap below. #
When I attempt to record an environment, it only records 1 second worth of video. What am I doing wrong?
import gym
env = gym.make("LunarLander-v2")
env.action_space.seed(42)
env = Recorder(env, './video')
observatio = env.reset()
# img = plt.imshow(env.render('rgb_array'))
observation = env.reset()
for _ in range(10000):
# img.set_data(env.render('rgb_array'))
# display.display(plt.gcf())
# display.clear_output(wait=True)
observation, reward, done, info = env.step(env.action_space.sample())
if done:
observation = env.reset()
env.release()
env.play()
env.close()
Legacy gym has migrated to Gymnasium. This package is not compatible.
in recording.py you use progress_bar argument which is deprecated from new versions of moviepy, now you should use logger ='bar' for
progress_bar=True and logger=None for False
Hey !
Thanks for this tool ! Actually I tried running it but keep getting the same error:
TypeError Traceback (most recent call last)
<ipython-input-2-3635bafa8091> in <module>
12 observation, reward, terminal, info = env.step(action)
13
---> 14 env.play()
/usr/local/lib/python3.9/dist-packages/colabgymrender/recorder.py in play(self)
70 filename = 'temp-{start}.mp4'
71 clip = VideoFileClip(self.path)
---> 72 clip.write_videofile(filename, progress_bar = False, verbose = False)
73 display(Video(filename, embed = True))
74 os.remove(filename)
TypeError: write_videofile() got an unexpected keyword argument 'progress_bar'
I guess it's related to the moviepy
library and that I don't have the right version thus could you specify which version is required ?
I followed the instructions and tutorial for Google colab and after my imports I get this error when running the wrapper?
Exception Traceback (most recent call last)
<ipython-input-12-35e2a7b78893> in <module>()
1
----> 2 env = gym.make("Breakout-v0")
3 directory = './video'
4 env = Recorder(env, directory)
4 frames
/usr/local/lib/python3.7/dist-packages/atari_py/games.py in get_game_path(game_name)
18 path = os.path.join(_games_dir, game_name) + ".bin"
19 if not os.path.exists(path):
---> 20 raise Exception('ROM is missing for %s, see https://github.com/openai/atari-py#roms for instructions' % (game_name,))
21 return path
22
Exception: ROM is missing for breakout, see https://github.com/openai/atari-py#roms for instructions`
```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.