examples icon indicating copy to clipboard operation
examples copied to clipboard

Fix: Update RL examples for recent gym 0.25.2 version

Open sanggusti opened this issue 2 years ago • 1 comments

There are bugs on env.state() since the current version of gym are having bugs with these examples. This commit is to solve it

Description

There are bugs on env.state() since the current version of gym are having bugs with these examples. This commit is to solve it.

The bug if rl examples run with current script:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-8-263240bbee7e>](https://localhost:8080/#) in <cell line: 1>()
----> 1 main()

[<ipython-input-4-6af08085b221>](https://localhost:8080/#) in main()
     87     running_reward = 10
     88     for i_episode in count(1):
---> 89         state, _ = env.reset()
     90         ep_reward = 0
     91         for t in range(1, 10000):  # Don't infinite loop while learning

ValueError: too many values to unpack (expected 2)

Type of change

Please delete options that are not relevant.

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Feature/Issue validation/testing

Please describe the tests [UT/IT] that you ran to verify your changes and relevant result summary. If this is a bug fix please run run_python_examples.sh before and after your change locally to make sure it works and add the logs here.

  • [ ] Logs before change
  • [ ] Logs after change

Checklist:

  • [ ] Have you added tests that prove your fix is effective or that this example works?
  • [ ] Has code been commented, particularly in hard-to-understand areas?
  • [ ] Have you made corresponding changes to the documentation?

sanggusti avatar Jan 10 '24 13:01 sanggusti

Deploy Preview for pytorch-examples-preview canceled.

Name Link
Latest commit 13db41abdfcc99f62312bff557f526ac352ecd49
Latest deploy log https://app.netlify.com/sites/pytorch-examples-preview/deploys/659e97e31e1cd00008feec4a

netlify[bot] avatar Jan 10 '24 13:01 netlify[bot]