# Restoring Tuned Tuner

**URL:** <https://discuss.ray.io/t/restoring-tuned-tuner/15286>\
**Category:** RLlib\
**Created:** [July 19, 2024, 3:03pm UTC](https://discuss.ray.io/t/restoring-tuned-tuner/15286 "2024-07-19T15:03:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tg03](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/tg03/32/4590_2.png) [@tg03](https://discuss.ray.io/u/tg03)\
**Post date:** [July 19, 2024, 3:03pm UTC](https://discuss.ray.io/t/restoring-tuned-tuner/15286/1 "2024-07-19T15:03:07Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- High: It blocks me to complete my task.

Hi,

I’ve been trying to figure this out for a while but can’t find out how to do it. I use `tune.fit()` to train my MAPPO model. Is there a way I can train the same model more once it has terminated? From what I can tell `tuner.restore` cannot be used for runs that finished training.

```python
tuner = tune.Tuner(
      CentralizedCritic,
      param_space = config.to_dict(),
      run_config = air.RunConfig(
          stop = {"timesteps_total": 200_000},
          storage_path = storage_path,
          checkpoint_config = train.CheckpointConfig(
              checkpoint_frequency = 5,
              checkpoint_at_end = True
          )
      ),
  )
  results = tuner.fit()

```

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![PhilippWillms](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/philippwillms/32/3885_2.png) [@PhilippWillms](https://discuss.ray.io/u/PhilippWillms)\
**Post date:** [July 19, 2024, 9:15pm UTC](https://discuss.ray.io/t/restoring-tuned-tuner/15286/2 "2024-07-19T21:15:46Z")

</div>

For also other readers to get right understanding: You want to save a model or policy after finished training ?

Maybe it is helpful to check on the link below what RLlib can offter here:  
[https://docs.ray.io/en/master/rllib/rllib-saving-and-loading-algos-and-policies.html#model-exports](https://docs.ray.io/en/master/rllib/rllib-saving-and-loading-algos-and-policies.html#model-exports)

---

<div class="post-metadata">

**Author:** ![tg03](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/tg03/32/4590_2.png) [@tg03](https://discuss.ray.io/u/tg03)\
**Post date:** [July 22, 2024, 9:37am UTC](https://discuss.ray.io/t/restoring-tuned-tuner/15286/3 "2024-07-22T09:37:32Z")

</div>

Sorry for not making it clear. I want to tune the model until the stopping conditions are met. My question relates to then continuing to train that same model (e.g. for another 200000 steps) ideally just continuing where it was last checkpoints (e.g. w.r.t. WandB).

---

<div class="post-metadata">

**Author:** ![PhilippWillms](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/philippwillms/32/3885_2.png) [@PhilippWillms](https://discuss.ray.io/u/PhilippWillms)\
**Post date:** [July 22, 2024, 5:50pm UTC](https://discuss.ray.io/t/restoring-tuned-tuner/15286/4 "2024-07-22T17:50:00Z")

</div>

Ok, in that case I recommend having a close look at [How to Save and Load Trial Checkpoints — Ray 3.0.0.dev0](https://docs.ray.io/en/master/tune/tutorials/tune-trial-checkpoints.html) . This would also include some experimentation which kind of checkpointing fits best for you.

---

<div class="post-metadata">

**Author:** ![mbusch-regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/mbusch-regis/32/4582_2.png) [@mbusch-regis](https://discuss.ray.io/u/mbusch-regis)\
**Post date:** [July 22, 2024, 7:33pm UTC](https://discuss.ray.io/t/restoring-tuned-tuner/15286/5 "2024-07-22T19:33:13Z")

</div>

Would this also be applicable if I want to continue training the model on an environment with different starting conditions?

I’m training using a simulation engine as my environment where episode length is a configurable number of steps and each step is a time interval. I want to be able to train my PPO model on a variety of different episode lengths and time intervals. Would I need to do something like the function checkpointing in the linked doc?

Thanks
