# Ray restore checkpoint in rllib

**URL:** <https://discuss.ray.io/t/ray-restore-checkpoint-in-rllib/3186>\
**Category:** RLlib\
**Created:** [August 10, 2021, 11:41am UTC](https://discuss.ray.io/t/ray-restore-checkpoint-in-rllib/3186 "2021-08-10T11:41:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kai](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/kai/32/3380_2.png) [@kai](https://discuss.ray.io/u/kai)\
**Post date:** [August 10, 2021, 1:15pm UTC](https://discuss.ray.io/t/ray-restore-checkpoint-in-rllib/3186/2 "2021-08-10T13:15:37Z")

</div>

Yep, you can use

```auto
analysis = tune.Analysis(experiment_path) # can also be the result of `tune.run()`

trial_logdir = analysis.get_best_logdir(metric="metric", mode="max") # Can also just specify trial dir directly

checkpoints = analysis.get_trial_checkpoints_paths(trial_logdir) # Returns tuples of (logdir, metric)
best_checkpoint = analysis.get_best_checkpoint(trial_logdir, metric="metric", mode="max")

```

See [Analysis (tune.analysis) — Ray v2.0.0.dev0](https://docs.ray.io/en/master/tune/api_docs/analysis.html#id1)

---

_[View the full topic](https://discuss.ray.io/t/ray-restore-checkpoint-in-rllib/3186)._
