Skip to content

Commit

Permalink
env.step wants 1D array, squeeze action
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-coady committed Aug 3, 2017
1 parent ebad3dd commit 2bb8af5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def run_episode(env, policy, scaler, animate=False):
observes.append(obs)
action = policy.sample(obs).reshape((1, -1)).astype(np.float64)
actions.append(action)
obs, reward, done, _ = env.step(action)
obs, reward, done, _ = env.step(np.squeeze(action))
if not isinstance(reward, float):
reward = np.asscalar(reward)
rewards.append(reward)
Expand Down

0 comments on commit 2bb8af5

Please sign in to comment.