# Saving checkpoints with good custom\_metric using tune.run()

**URL:** https://discuss.ray.io/t/saving-checkpoints-with-good-custom-metric-using-tune-run/2109
**Category:** Ray Tune
**Created:** [May 9, 2021, 7:03am UTC](https://discuss.ray.io/t/saving-checkpoints-with-good-custom-metric-using-tune-run/2109 "2021-05-09T07:03:11Z")
**Posts on this page:** 1
**Showing post:** 11

<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: [May 13, 2021, 1:20am UTC](https://discuss.ray.io/t/saving-checkpoints-with-good-custom-metric-using-tune-run/2109/11 "2021-05-13T01:20:40Z")

</div>

Glad it worked. I figured out the issue with the csv logger. The very first time it logs data using the “on\_result” method is when it creates the file and determines the “fieldnames” (flattened keys) that it will log for the duration of the experiment.

In an example like yours where you are doing evaluations n \> 1 the evaluation keys will not be in that first set of results and so in subsequent calls to “on\_result” they will be ignored. This will also be true for your custom\_metrics keys if you only add them when in evaluation.

I think it will be hard to change the behavior of the csv logger. Instead it might be easier to have the ExperimentAnanlysis class build the dataframe from the json log file.

---

_[View the full topic](https://discuss.ray.io/t/saving-checkpoints-with-good-custom-metric-using-tune-run/2109)._
