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] restore_1_of_n_agents_from_checkpoint does not actually seem to work #32751

Open
Phirefly9 opened this issue Feb 22, 2023 · 0 comments
Open
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 rllib-docs-or-examples Issues related to RLlib documentation or rllib/examples

Comments

@Phirefly9
Copy link

What happened + What you expected to happen

My team tried to use the example code
https://github.com/ray-project/ray/blob/ray-2.2.0/rllib/examples/restore_1_of_n_agents_from_checkpoint.py

as a basis for loading a pre-trained policy, however we think the example callback is missing a call to sync the worker weights

once we did that everything worked fine, but without the sync_weights the policy was random

Versions / Dependencies

ray/rllib 2.2
python 3.10.8

Reproduction script

the adjusted callback in the example should be:

 class RestoreWeightsCallback(DefaultCallbacks):
        def on_algorithm_init(self, *, algorithm: "Algorithm", **kwargs) -> None:
            algorithm.set_weights({"policy_0": restored_policy_0.get_weights()})
            algorithm.workers.sync_weights()

Issue Severity

Low: It annoys or frustrates me.

@Phirefly9 Phirefly9 added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Feb 22, 2023
@kouroshHakha kouroshHakha added P1 Issue that should be fixed within a few weeks rllib RLlib related issues and removed triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Feb 24, 2023
@Rohan138 Rohan138 added the rllib-docs-or-examples Issues related to RLlib documentation or rllib/examples label Apr 20, 2023
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 rllib-docs-or-examples Issues related to RLlib documentation or rllib/examples
Projects
None yet
Development

No branches or pull requests

3 participants