-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rllib] "TypeError: Object of type 'Box' is not JSON serializable" happen when checkpointing at Ray 0.7 #4613
Comments
By the way, I have try the example codes without any argument / modification at multiagent_cartpole.py. The same error printed each time Ray checkpointing. |
I have looked up the same codes in Ray 0.6.5, the
I think this explain why the Ray 0.6.5 do not raise such error. |
Ah, this seems to be due to #4519 Should we revert that @richardliaw ? |
Hm, so we need to have some part of the config properly jsonified for CLI viewing. I think the proper fix is to have the encoder fall back to cloudpickle if fails? |
There's the safe fallback encoder?
…On Fri, Apr 12, 2019, 3:39 PM Richard Liaw ***@***.***> wrote:
Hm, so we need to have some part of the config properly jsonified for CLI
viewing. I think the proper fix is to have the encoder fall back to
cloudpickle if fails?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#4613 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAA6SniWzkPZ5B5TGSAvB6Edp7qRY7hUks5vgQsOgaJpZM4csNM7>
.
|
Looks like safe fallback gets around this by removing the config (in
`pretty_print`). Let me push a PR for a cloudpickle fallback...
…On Fri, Apr 12, 2019 at 4:22 PM Eric Liang ***@***.***> wrote:
There's the safe fallback encoder?
On Fri, Apr 12, 2019, 3:39 PM Richard Liaw ***@***.***>
wrote:
> Hm, so we need to have some part of the config properly jsonified for CLI
> viewing. I think the proper fix is to have the encoder fall back to
> cloudpickle if fails?
>
> —
> You are receiving this because you were assigned.
> Reply to this email directly, view it on GitHub
> <#4613 (comment)>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AAA6SniWzkPZ5B5TGSAvB6Edp7qRY7hUks5vgQsOgaJpZM4csNM7
>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4613 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEUc5YOdRUO_REtt99aM3jo3Oq9X6v_Rks5vgRU3gaJpZM4csNM7>
.
|
System information
I have setup a policy_graphs for multi-agent senario:
wherein obs_space and act_space are both
gym.space.Box
objects. Concretely, the obs_space is Box(316, ), and the act_space is Box(2,). I am using a custom environment. My environments has observation space like:obs_space = {k: Box(316,) for k in agents.keys()}
I use the observation_space of one of the agents as the obs_space here, in policy_graphs. Therefore I don't think my custom environment causes the problem.
Then running tune with:
which is cloned from the example codes: https://github.com/ray-project/ray/blob/master/python/ray/rllib/examples/multiagent_cartpole.py
Then I got the error:
I tried to dive in to the error. And find that at
ray/tune/trial_runner.py
, the functioncheckpoint
gatherrunner_state
and usesjson.dump
to store them.I find that the runner_state have structure like:
Therefore, it is the policy graph in the
multiagent
key in the agent.config cause the problem.I have try the same codes using Ray 0.6.5, with only one modification, the definition of policy graph:
and it turn out that no error is printed.
The error message pop up in the checkpoint frequency. And it do not stop the main process of training. I am not sure is that a common phenomena introduced by Ray 0.7.0 or just a trivial error.
The text was updated successfully, but these errors were encountered: