# Escaped string in checkpoints from Experiment\_state.json

**URL:** <https://discuss.ray.io/t/escaped-string-in-checkpoints-from-experiment-state-json/1003>\
**Category:** RLlib\
**Created:** [February 24, 2021, 6:21pm UTC](https://discuss.ray.io/t/escaped-string-in-checkpoints-from-experiment-state-json/1003 "2021-02-24T18:21:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kepricon](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/kepricon/32/378_2.png) [@kepricon](https://discuss.ray.io/u/kepricon)\
**Post date:** [February 24, 2021, 6:21pm UTC](https://discuss.ray.io/t/escaped-string-in-checkpoints-from-experiment-state-json/1003/1 "2021-02-24T18:21:36Z")

</div>

I recently updated Ray version 1.2.0 from 1.0.0.

I noticed the content of `experiment_state-xxx.json` is changed a bit.  
precisely, the value of `checkpoints` has an escape sequence.

from Ray 1.0.0, we got

```auto
{
  "checkpoints": [
    {
      "trainable_name": "PPO",
      "trial_id": "5eb76_00000",
...

```

from Ray 1.2.0, we got

```auto
{
  "checkpoints": [
    "{\n \"trainable_name\": \"PPO\",\n \"trial_id\": \"8cee3_00000\", ...

```

it has `\n` and `\"`.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/ray/original/1X/b1ed43b96ff8bc84b1a632c33064b5f42f51fef4.png)

It only happens at the value of `checkpoints` but `runner_data` and `stats` seem to have valid JSON format.  
Do you happen to know how to fix this?  
or Can you point me out which codes or documents I should see?

Thank you.

---

<div class="post-metadata">

**Author:** ![rliaw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/rliaw/32/24_2.png) [@rliaw](https://discuss.ray.io/u/rliaw)\
**Post date:** [February 24, 2021, 6:49pm UTC](https://discuss.ray.io/t/escaped-string-in-checkpoints-from-experiment-state-json/1003/2 "2021-02-24T18:49:00Z")

</div>

> [@kepricon](#):
>
> It only happens at the value of `checkpoints` but `runner_data` and `stats` seem to have valid JSON format.

This was a recent change introduced to make checkpoints faster – what are you trying to do here?

---

<div class="post-metadata">

**Author:** ![kepricon](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/kepricon/32/378_2.png) [@kepricon](https://discuss.ray.io/u/kepricon)\
**Post date:** [February 24, 2021, 7:30pm UTC](https://discuss.ray.io/t/escaped-string-in-checkpoints-from-experiment-state-json/1003/3 "2021-02-24T19:30:21Z")

</div>

Hi @rliaw  
thanks for the comment.

we are relying on `experiment_state.json` to periodically get status of trials during the training.  
As I mentioned we changed the ray version recently, It doesn’t work with our current code.  
So i tried to make sure this is on purpose or not and thank you for the confirmation.

Could you share the relevant code or PR about this change?  
If I could know the change, I’d be helpful to change our code.

Thank you.

---

<div class="post-metadata">

**Author:** ![kepricon](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/kepricon/32/378_2.png) [@kepricon](https://discuss.ray.io/u/kepricon)\
**Post date:** [February 24, 2021, 11:27pm UTC](https://discuss.ray.io/t/escaped-string-in-checkpoints-from-experiment-state-json/1003/4 "2021-02-24T23:27:45Z")

</div>

I found it.  
looks like [[tune] cache checkpoint serialization by krfricke · Pull Request #12064 · ray-project/ray · GitHub](https://github.com/ray-project/ray/pull/12064)

---

<div class="post-metadata">

**Author:** ![rliaw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/rliaw/32/24_2.png) [@rliaw](https://discuss.ray.io/u/rliaw)\
**Post date:** [February 25, 2021, 5:06am UTC](https://discuss.ray.io/t/escaped-string-in-checkpoints-from-experiment-state-json/1003/5 "2021-02-25T05:06:12Z")

</div>

Yeah, I think it is preferable that you do not rely on experiment\_state.json. You should use something like `Analysis` or `ExperimentAnalysis`.
