# How to prevent ray tune fit from printing redundent information?

**URL:** <https://discuss.ray.io/t/how-to-prevent-ray-tune-fit-from-printing-redundent-information/11100>\
**Category:** Ray Tune\
**Created:** [June 20, 2023, 11:45am UTC](https://discuss.ray.io/t/how-to-prevent-ray-tune-fit-from-printing-redundent-information/11100 "2023-06-20T11:45:27Z")\
**Posts on this page:** 6\
**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:** [June 20, 2023, 11:45am UTC](https://discuss.ray.io/t/how-to-prevent-ray-tune-fit-from-printing-redundent-information/11100/1 "2023-06-20T11:45:27Z")

</div>

Hi all,

I am using `tune.fit` to train an RL agent, but in each iteration, `ray` prints out a lot of information making tracking and debugging a bit difficult.

The default verbose in `tune.fit(verbose=1)` is `1` which prints out a lot of info shown in the following image.

 ![Screenshot from 2023-06-20 13-14-52](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/7/747efd34dfa8a3ec23b4b4f8800df0a687aecf92.jpeg)

If you set verbose to `0`, it does not print anything, but it is not what I want.

I want the `tune.fit` to only print the following table, not the other information.

 ![Screenshot from 2023-06-20 13-44-11](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/6/6acfdfd6315dab1d3e1754576f771616b80cbe68.png)

I wonder if anyone knows how to make it. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![arturn](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/arturn/32/2096_2.png) [@arturn](https://discuss.ray.io/u/arturn)\
**Post date:** [June 20, 2023, 6:23pm UTC](https://discuss.ray.io/t/how-to-prevent-ray-tune-fit-from-printing-redundent-information/11100/2 "2023-06-20T18:23:22Z")

</div>

This is internal to tune. RLlib onyl returns a results dictionary and tune will decide what to print from it. I’m moving this to the Ray AIR folks 🙂

---

<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:** [June 21, 2023, 8:05am UTC](https://discuss.ray.io/t/how-to-prevent-ray-tune-fit-from-printing-redundent-information/11100/3 "2023-06-21T08:05:17Z")

</div>

Hi @deepgravity,

usually you should get the expected output with `verbose=1`. The default is `2`, which matches the output you show.

We are refactoring the output engine, and you can try out the new layout by setting the environment variable `RAY_AIR_NEW_OUTPUT=1`. This works best on the nightly wheels. Do you want to give that a try and test it with `AirVerbosity.DEFAULT`?

For more details, see

[https://docs.ray.io/en/latest/ray-air/experimental-features.html](https://docs.ray.io/en/latest/ray-air/experimental-features.html)

---

<div class="post-metadata">

**Author:** ![arturn](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/arturn/32/2096_2.png) [@arturn](https://discuss.ray.io/u/arturn)\
**Post date:** [June 21, 2023, 3:47pm UTC](https://discuss.ray.io/t/how-to-prevent-ray-tune-fit-from-printing-redundent-information/11100/4 "2023-06-21T15:47:12Z")

</div>

If all of this does not lead to your goal, you can also write a custom callback to filter out metrics that you don’t need.

---

<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:** [June 21, 2023, 9:53pm UTC](https://discuss.ray.io/t/how-to-prevent-ray-tune-fit-from-printing-redundent-information/11100/5 "2023-06-21T21:53:30Z")

</div>

> [@kai](#):
>
> AirVerbosity.DEFAULT

Hi @kai,  
Many thanks for your reply.

Yes, that worked for me. Indeed:

```auto
import os 
os.environ['RAY_AIR_NEW_OUTPUT'] = '1'

from ray.tune.experimental.output import AirVerbosity, get_air_verbosity 

run_config = air.RunConfig(verbose=get_air_verbosity(AirVerbosity.DEFAULT))

```

Now, I have the following log:

 ![2023-06-21 23_43_35-Window](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/e/e8fe4cbdc9cb237549b17beee31f5d9a397f1483.png)

Only prints the most important measurements.

I think here `episodes_total` is equivalent to `iters` that we had before right?

I also have a suggestion. I would even be happier to have only one dynamic table that changes after like every 10 episodes; rather than having multiple new static tables.

This is because I am already tracking the progress on `tensorboard` or `wandb`. So I do not need to have the whole run history in the terminal. The terminal is good only for quick debugging. So, having only one dynamic table would be enough.

Thanks anyway 🙂

---

<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:** [June 23, 2023, 2:14pm UTC](https://discuss.ray.io/t/how-to-prevent-ray-tune-fit-from-printing-redundent-information/11100/6 "2023-06-23T14:14:17Z")

</div>

Thanks @deepgravity, we’re actually working on this with out [sticky layout](https://docs.ray.io/en/latest/ray-air/experimental-features.html#rich-layout-sticky-status). You can try it out already (`RAY_AIR_RICH_LAYOUT=1`) - but please note that it’s _very_ experimental right now and probably has a few bugs 🙂
