Skip to content

Commit

Permalink
[RLlib] Check that results has learner info appo test (ray-project#34381
Browse files Browse the repository at this point in the history
)

The appo kl coefficient learner test is flakey because
we run training until there are some results. What can end up happening is that
training is run for so long that eval results are available but not learner results
This pr fixes this by training until there are learner results that are available
not just evaluation results.

Signed-off-by: Avnish <[email protected]>
Signed-off-by: Jack He <[email protected]>
  • Loading branch information
avnishn authored and ProjectsByJackHe committed May 4, 2023
1 parent be9e063 commit 710a7af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rllib/algorithms/appo/tests/tf/test_appo_learner.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_kl_coeff_changes(self):
# a asynchronous trainer and results are returned asynchronously.
while 1:
results = algo.train()
if results:
if results and "info" in results and LEARNER_INFO in results["info"]:
break
curr_kl_coeff = results["info"][LEARNER_INFO][DEFAULT_POLICY_ID][
LEARNER_STATS_KEY
Expand Down

0 comments on commit 710a7af

Please sign in to comment.