Skip to content
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] Restored experiments params.json incorrectly serialized #41370

Closed
ahmedammar opened this issue Nov 24, 2023 · 1 comment · Fixed by #42116
Closed

[RLlib] Restored experiments params.json incorrectly serialized #41370

ahmedammar opened this issue Nov 24, 2023 · 1 comment · Fixed by #42116
Assignees
Labels
bug Something that is supposed to be working; but isn't P1 Issue that should be fixed within a few weeks rllib RLlib related issues

Comments

@ahmedammar
Copy link

ahmedammar commented Nov 24, 2023

What happened + What you expected to happen

When restoring an experiment using tune.Experiment() the created params.json contains the non-serialized AlgoConfig, for example:

❯ cat params.json
"<ray.rllib.algorithms.ppo.ppo.PPOConfig object at 0xfffed410ed70>"

Seems like this object is not being serialized to json, instead the object reference is being dumped to params.json file.

params.pkl is fine though, but just reporting this as I noticed it.

Versions / Dependencies

Ray: 2.8.0
Python: 3.10.13
OS: Linux

Reproduction script

experiment_spec = tune.Experiment(
    name=None,
    run="PPO",
    checkpoint_config=ray.air.CheckpointConfig(
        checkpoint_frequency=10,
        checkpoint_score_attribute="episode_reward_mean",
        num_to_keep=20,
    ),
    config=config,
    restore=$SOME_PREV_CHECKPOINTG
)

results = tune.run_experiments(
    experiments=experiment_spec,
    verbose=1,
) 

Issue Severity

Medium: It is a significant difficulty but I can work around it.

@ahmedammar ahmedammar added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Nov 24, 2023
@anyscalesam anyscalesam added the tune Tune-related issues label Nov 28, 2023
@matthewdeng matthewdeng added rllib RLlib related issues and removed tune Tune-related issues labels Nov 28, 2023
@matthewdeng matthewdeng changed the title [Tune] Restored experiments params.json incorrectly serialized [RLlib] Restored experiments params.json incorrectly serialized Nov 28, 2023
@sven1977 sven1977 added P1 Issue that should be fixed within a few weeks and removed triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Dec 18, 2023
@simonsays1980
Copy link
Collaborator

@ahmedammar thanks for posting this. I have created a PR that should fix this issue. The reason was that our AlgorithmConfig is not a dicitonary and therefore its method to_dict() has to be called in the JsonLogger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't P1 Issue that should be fixed within a few weeks rllib RLlib related issues
Projects
None yet
5 participants