You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "e:\python\cod\codes\rl-pendulum\Pendulum_DQN\pendulum_dqn.py", line 155, in
action, real_action, count = agent.choose_action(torch.FloatTensor(state))
^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: expected sequence of length 3 at dim 1 (got 0)
The text was updated successfully, but these errors were encountered:
To fix this, go to line 149 and change it from state = env.reset() to state, _ = env.reset()
This code is according to old gym and does not account for new gym
You'll likely encounter another problem at line 156 as well,
change any instance of state_prime, reward, done, _ = env.step([real_action]) to state_prime, reward, done, truncated, _ = env.step([real_action])
and then change at line 153 from while not done to while not (done or truncated)
File "e:\python\cod\codes\rl-pendulum\Pendulum_DQN\pendulum_dqn.py", line 155, in
action, real_action, count = agent.choose_action(torch.FloatTensor(state))
^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: expected sequence of length 3 at dim 1 (got 0)
The text was updated successfully, but these errors were encountered: