# Specify which layers to restore

**URL:** <https://discuss.ray.io/t/specify-which-layers-to-restore/9902>\
**Category:** RLlib\
**Created:** [March 27, 2023, 12:16am UTC](https://discuss.ray.io/t/specify-which-layers-to-restore/9902 "2023-03-27T00:16:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shawan\_Mohammed](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/shawan_mohammed/32/4111_2.png) [@Shawan\_Mohammed](https://discuss.ray.io/u/Shawan_Mohammed)\
**Post date:** [March 27, 2023, 12:16am UTC](https://discuss.ray.io/t/specify-which-layers-to-restore/9902/1 "2023-03-27T00:16:59Z")

</div>

How to restore only a part of the neural network in rllib? Does “custom\_model\_config” have a layer wise restore parameter which I can use?

---

<div class="post-metadata">

**Author:** ![mannyv](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/mannyv/32/606_2.png) [@mannyv](https://discuss.ray.io/u/mannyv)\
**Post date:** [March 27, 2023, 1:35am UTC](https://discuss.ray.io/t/specify-which-layers-to-restore/9902/2 "2023-03-27T01:35:22Z")

</div>

Hi @Shawan_Mohammed,

Welcome to the forum.

This kind of feature is not built into rllib. One option you have is to create your own custom policy and override the set\_weights method.

Here is the current set\_weights method for torch as an example.

> <https://github.com/ray-project/ray/blob/10d12f8220d133b76b33ca6b5a1eeb72636f2b4c/rllib/policy/torch_policy.py#L734>
