Skip to content

Commit

Permalink
Print episode stats iff ep ended during collect
Browse files Browse the repository at this point in the history
  • Loading branch information
dantp-ai committed Jan 3, 2024
1 parent 1468cdf commit a6a13ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/offline/test_bcq.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ def watch():
policy.eval()
collector = Collector(policy, env)
res = collector.collect(n_episode=1, render=args.render)
print(f"Final reward: {res.returns_stat.mean}, length: {res.lens_stat.mean}")
if res.returns_stat and res.lens_stat:
print(f"Final reward: {res.returns_stat.mean}, length: {res.lens_stat.mean}")


if __name__ == "__main__":
Expand Down

0 comments on commit a6a13ce

Please sign in to comment.