# ValueError: The parameter loc has invalid values

**URL:** <https://discuss.ray.io/t/valueerror-the-parameter-loc-has-invalid-values/3959>\
**Category:** Ray Tune\
**Created:** [October 28, 2021, 12:04am UTC](https://discuss.ray.io/t/valueerror-the-parameter-loc-has-invalid-values/3959 "2021-10-28T00:04:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Athe-kunal](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/athe-kunal/32/1662_2.png) [@Athe-kunal](https://discuss.ray.io/u/Athe-kunal)\
**Post date:** [October 28, 2021, 12:04am UTC](https://discuss.ray.io/t/valueerror-the-parameter-loc-has-invalid-values/3959/1 "2021-10-28T00:04:12Z")

</div>

I am trying Ray tune wrapper for Optuna to tune my Stable Baslines3 model. But I am getting this error ValueError: The parameter loc has invalid values. This occurs probably when we divide by zero, that is when the model diverges. In Optuna there is a catch parameter that ignores value error and tries out the next set of hyperparameters. It is present in the optimised attribute of the study created. But I could not find the source code for the wrapper [Source code for Wrapper](https://docs.ray.io/en/latest/_modules/ray/tune/suggest/optuna.html). Is there a similar way to do this in ray tune? How can I handle this exception? Thanks in advance
