Skip to content

Commit

Permalink
[bug-fix] Use correct agent_ids for demo loader (#3464)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ervin T authored Feb 18, 2020
1 parent a5626aa commit 596c364
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions com.unity.ml-agents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Bugfixes
- Fixed an issue which caused self-play training sessions to consume a lot of memory. (#3451)
- Fixed an IndexError when using GAIL or behavioral cloning with demonstrations recorded with 0.14.0 or later (#3464)

## [0.14.0-preview] - 2020-02-13

Expand Down
7 changes: 4 additions & 3 deletions ml-agents/mlagents/trainers/demo_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ def make_demo_buffer(
previous_action = np.array(
pair_infos[idx - 1].action_info.vector_actions, dtype=np.float32
)
agent_id = current_step_info.agent_id[0]
current_agent_step_info = current_step_info.get_agent_step_result(agent_id)
next_agent_step_info = next_step_info.get_agent_step_result(agent_id)
curr_agent_id = current_step_info.agent_id[0]
current_agent_step_info = current_step_info.get_agent_step_result(curr_agent_id)
next_agent_id = next_step_info.agent_id[0]
next_agent_step_info = next_step_info.get_agent_step_result(next_agent_id)

demo_raw_buffer["done"].append(next_agent_step_info.done)
demo_raw_buffer["rewards"].append(next_agent_step_info.reward)
Expand Down

0 comments on commit 596c364

Please sign in to comment.