Q-Learner question from chapter 5 #41
-
I was trying to run Q_learner_MountainCar.py in Chapter 5. I had an issue running it. I think the issue is in:
I get a: TypeError: unsupported operand type(s) for -: 'dict' and 'float' The script was written for learning environments like |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Note that Chapter 5 code does use 'MountainCar-vo'. It is that env that throws the error. |
Beta Was this translation helpful? Give feedback.
-
Hi @jesmitty , Recommended Solution More details The Gym library has changed the interface contract of the Alternate Solution with: obs, _ = env.reset()
|
Beta Was this translation helpful? Give feedback.
Hi @jesmitty ,
Thank you for posting on the discussion thread with the details. Upon debugging to reproduce the issue you reported, it turns out, you are using a different version of the OpenAI Gym library than the version used in the Book's recipe samples which is pinned down in the python environment spec here.
Recommended Solution
To resolve the issue you reported, you may want to install the recommended
gym
library version in your python environment. For example, by running this command:pip install gym==0.10.5
.More details
The Gym library has changed the interface contract of the
reset()
method in this commit to return an auxiliary information dict in addition to the observation when…