rl icon indicating copy to clipboard operation
rl copied to clipboard

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

Open jianzhnie opened this issue 1 year ago • 0 comments

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 avatar Oct 30 '24 02:10 jianzhnie