Skip to content

Commit 0c25e5b

Browse files
Ervin Tanupambhatnagar
authored andcommitted
[bug-fix] Use correct agent_ids for demo loader (#3464)
1 parent 35f4d71 commit 0c25e5b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

com.unity.ml-agents/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1919

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

2324

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

ml-agents/mlagents/trainers/demo_loader.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ def make_demo_buffer(
5151
previous_action = np.array(
5252
pair_infos[idx - 1].action_info.vector_actions, dtype=np.float32
5353
)
54-
agent_id = current_step_info.agent_id[0]
55-
current_agent_step_info = current_step_info.get_agent_step_result(agent_id)
56-
next_agent_step_info = next_step_info.get_agent_step_result(agent_id)
54+
curr_agent_id = current_step_info.agent_id[0]
55+
current_agent_step_info = current_step_info.get_agent_step_result(curr_agent_id)
56+
next_agent_id = next_step_info.agent_id[0]
57+
next_agent_step_info = next_step_info.get_agent_step_result(next_agent_id)
5758

5859
demo_raw_buffer["done"].append(next_agent_step_info.done)
5960
demo_raw_buffer["rewards"].append(next_agent_step_info.reward)

0 commit comments

Comments
 (0)