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

[BUG] RuntimeError: Setting 'advantage' via the constructor is deprecated, use .set_keys(<key>='some_key') instead . #2528

Open
jianzhnie opened this issue Oct 30, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jianzhnie
Copy link

Describe the bug

When run the example
https://github.com/pytorch/rl/blob/main/examples/distributed/collectors/multi_nodes/ray_train.py
i meet following bug:
UserWarning: init_random_frames (-1) is not exactly a multiple of frames_per_batch (1000), this results in more init_random_frames than requested (0).To silence this message, set the environment variable RL_WARNINGS to False.
(SyncDataCollector pid=61650) warnings.warn(
Traceback (most recent call last):
File "/home/robin/work_dir/rlcode/distributed_rl/rl/examples/distributed/collectors/multi_nodes/ray_train.py", line 150, in
loss_module = ClipPPOLoss(
File "/home/robin/miniconda3/envs/ml/lib/python3.9/site-packages/torchrl/objectives/ppo.py", line 797, in init
super(ClipPPOLoss, self).init(
File "/home/robin/miniconda3/envs/ml/lib/python3.9/site-packages/torchrl/objectives/ppo.py", line 384, in init
self._set_deprecated_ctor_keys(
File "/home/robin/miniconda3/envs/ml/lib/python3.9/site-packages/torchrl/objectives/common.py", line 215, in _set_deprecated_ctor_keys
raise RuntimeError(
RuntimeError: Setting 'advantage' via the constructor is deprecated, use .set_keys(='some_key') instead.

To Reproduce

python examples/distributed/collectors/multi_nodes/ray_train.py
@jianzhnie jianzhnie added the bug Something isn't working label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants