vojtamolda / reinforcement-learning-an-introduction

Solutions to exercises in Reinforcement Learning: An Introduction (2nd Edition).
325 stars 71 forks source link

error when running sarsa code #16

Closed sinamcr7 closed 1 year ago

sinamcr7 commented 1 year ago

when I try to run code for sansa it shows this error and I couldn't find any solution in the internet:

Traceback (most recent call last):
  File "\PycharmProjects\test_gym\main.py", line 59, in <module>
    q, policy, _ = sarsa(env, 500, eps0=0.5, alpha=0.5)
  File "\PycharmProjects\test_gym\sarsa.py", line 57, in sarsa
    next_state, reward, done, _, info = env.step(action)
  File "\anaconda3\envs\gym\lib\site-packages\gym\wrappers\time_limit.py", line 50, in step
    observation, reward, terminated, truncated, info = self.env.step(action)
ValueError: not enough values to unpack (expected 5, got 4)

Process finished with exit code 1

please help me fix this

vojtamolda commented 1 year ago

Can you, please, provide me with a way to reproduce it? I'm not sure what script you're running and how.

vojtamolda commented 1 year ago

I'm closing this as a stale issue, since I don't have a way to reproduce.