# Trials did not complete

**URL:** <https://discuss.ray.io/t/trials-did-not-complete/951>\
**Category:** RLlib\
**Created:** [February 20, 2021, 6:51pm UTC](https://discuss.ray.io/t/trials-did-not-complete/951 "2021-02-20T18:51:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepgravity](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/deepgravity/32/2039_2.png) [@deepgravity](https://discuss.ray.io/u/deepgravity)\
**Post date:** [February 20, 2021, 6:51pm UTC](https://discuss.ray.io/t/trials-did-not-complete/951/1 "2021-02-20T18:51:38Z")

</div>

Hi,  
I am beginner in Rllib.  
I downloaded the following code and run it on TF.

> <https://github.com/ray-project/ray/blob/master/rllib/examples/custom_env.py>

But I got this error:  
`TuneError: ('Trials did not complete', [PPO_SimpleCorridor_e5404_00000, PPO_SimpleCorridor_e5404_00001, PPO_SimpleCorridor_e5404_00002])`

Would you please help me to figure out how to resolve it?  
Thanks

---

<div class="post-metadata">

**Author:** ![deepgravity](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/deepgravity/32/2039_2.png) [@deepgravity](https://discuss.ray.io/u/deepgravity)\
**Post date:** [February 21, 2021, 1:17pm UTC](https://discuss.ray.io/t/trials-did-not-complete/951/2 "2021-02-21T13:17:31Z")

</div>

I fixed this issue by adding the following line to the ` __init__ ` method of the `custom_model`:  
`self.register_variables(self.model.variables())`

---

<div class="post-metadata">

**Author:** ![sven1977](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sven1977/32/53_2.png) [@sven1977](https://discuss.ray.io/u/sven1977)\
**Post date:** [March 1, 2021, 1:12pm UTC](https://discuss.ray.io/t/trials-did-not-complete/951/3 "2021-03-01T13:12:12Z")

</div>

This could be due to you using a prior version of RLlib (which did require to register all TFModelV2 weights manually). This should be fixed in the latest master. I just tried this again to confirm. This script is also part of our per-PR regression test suite.

---

<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:** [April 14, 2023, 5:08pm UTC](https://discuss.ray.io/t/trials-did-not-complete/951/4 "2023-04-14T17:08:12Z")

</div>

Yes, meanwhile the `self.register_variables` makes it not runnable at all, so hopefully this is no longer a source of issues 😉
