Skip to content

Commit

Permalink
Fix gif example in the doc (#624)
Browse files Browse the repository at this point in the history
* changed the img[0] to img.

In this example, images are a list of image rendered in the environment, and here we should use img instead of img[0] which is 3 (rgb channels). Using img[0] will make a wrong GIF file.

* Update changelog.rst

Co-authored-by: Antonin RAFFIN <antonin.raffin@ensta.org>
  • Loading branch information
KuKuXia and araffin committed Feb 1, 2020
1 parent 76e7cc0 commit 34d2bee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/guide/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -632,4 +632,4 @@ Bonus: Make a GIF of a Trained Agent
obs, _, _ ,_ = model.env.step(action)
img = model.env.render(mode='rgb_array')
imageio.mimsave('lander_a2c.gif', [np.array(img[0]) for i, img in enumerate(images) if i%2 == 0], fps=29)
imageio.mimsave('lander_a2c.gif', [np.array(img) for i, img in enumerate(images) if i%2 == 0], fps=29)
3 changes: 2 additions & 1 deletion docs/misc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Others:

Documentation:
^^^^^^^^^^^^^^
- Fixed example for creating a GIF (@KuKuXia)


Release 2.9.0 (2019-12-20)
Expand Down Expand Up @@ -610,4 +611,4 @@ Thanks to @bjmuld @iambenzo @iandanforth @r7vme @brendenpetersen @huvar @abhiskk
@XMaster96 @kantneel @Pastafarianist @GerardMaggiolino @PatrickWalter214 @yutingsz @sc420 @Aaahh @billtubbs
@Miffyli @dwiel @miguelrass @qxcv @jaberkow @eavelardev @ruifeng96150 @pedrohbtp @srivatsankrishnan @evilsocket
@MarvineGothic @jdossgollin @SyllogismRXS @rusu24edward @jbulow @Antymon @seheevic @justinkterry @edbeeching
@flodorner
@flodorner @KuKuXia

0 comments on commit 34d2bee

Please sign in to comment.