Skip to content

Commit 596c364

Browse files
author
Ervin T
authored
[bug-fix] Use correct agent_ids for demo loader (#3464)
1 parent a5626aa commit 596c364

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
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2121

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

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

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)