Skip to content

Commit

Permalink
[RLlib] Fix policy restore. Avoid keyward params. (#29227) (#29251)
Browse files Browse the repository at this point in the history
Signed-off-by: Jun Gong <[email protected]>
  • Loading branch information
Jun Gong authored Oct 13, 2022
1 parent 9736d15 commit a0ba4f2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions rllib/policy/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,12 @@ def from_state(state: PolicyState) -> "Policy":

# Create the new policy.
new_policy = pol_spec.policy_class(
observation_space=pol_spec.observation_space,
action_space=pol_spec.action_space,
config=pol_spec.config,
# Note(jungong) : we are intentionally not using keyward arguments here
# because some policies name the observation space parameter obs_space,
# and some others name it observation_space.
pol_spec.observation_space,
pol_spec.action_space,
pol_spec.config,
)

# Set the new policy's state (weights, optimizer vars, exploration state,
Expand Down

0 comments on commit a0ba4f2

Please sign in to comment.