MushroomRL / mushroom-rl

Python library for Reinforcement Learning.
MIT License
814 stars 148 forks source link

'Taxi-v3' error: "ValueError: too many values to unpack (expected 4)" #133

Closed liar666 closed 11 months ago

liar666 commented 11 months ago

Describe the bug Trying to use the taxi-v3 example, I get an error. The errir comes from the internals of MushroomRL.

To Reproduce Here is a MVE that raises the error:

from mushroom_rl.core import Environment
env = Environment.make('Gym', 'Taxi-v3')
env.reset()

env.step([0])

Last instruction is trying to mimic the line obs, reward, absorbing, info = self.env.step(action) which is called when I call core.learn(n_episodes=1000, n_steps_per_fit=1)

Expected behavior Examples included in MushroomRL should run flawlessly

System information (please complete the following information):

Additional context Trying to execute a code that was working perfectly last year

liar666 commented 11 months ago

The problem lies probably in an update of gym that MushroomRL did not reflect. It would be great to have a table of corresponding versions of gym & MushroomRL in the docs.

boris-il-forte commented 11 months ago

Thanks for reporting. Due to the many interface breaks happening in the version after 0.24, we decided to wait for a stable interface. Unfortunately, Gym is no longer supported by OpenAI, therefore we are porting the class to the newer version, Gymnasium. This will be done for the 2.0 branch.

Regarding the gym version, in the setup.py file, we fix a specific version of it to be used:

see here: https://github.com/MushroomRL/mushroom-rl/blob/95b5297733185183f1e7709d2d51f39de0665ae7/setup.py#L33

This will be the only version supported by MushroomRL 1.X. For future releases, we will always support the latest version of Gymnasium, but the development of 2.0 will take some time.