ray
ray copied to clipboard
[RLlib] Deprecation warnings won't turn off
What happened + What you expected to happen
The bug
Default instantiation of RLlib
algorithms causes deprecation warnings (even when the new API stack is selected). Furthermore, I cannot disable them by setting os.environ
nor by calling ray.init
with env_vars
.
Expected behavior
No deprecation warnings when all packages and dependencies are at their newest versions. At least the warnings should be disableable.
Output message
2024-06-10 20:35:37,461 INFO worker.py:1753 -- Started a local Ray instance.
anaconda/envs/sddl/lib/python3.11/site-packages/ray/rllib/algorithms/algorithm.py:525: RayDeprecationWarning: This API is deprecated and may be removed in future Ray releases. You could suppress this warning by setting env variable PYTHONWARNINGS="ignore::DeprecationWarning"
`UnifiedLogger` will be removed in Ray 2.7.
return UnifiedLogger(config, logdir, loggers=None)
anaconda/envs/sddl/lib/python3.11/site-packages/ray/tune/logger/unified.py:53: RayDeprecationWarning: This API is deprecated and may be removed in future Ray releases. You could suppress this warning by setting env variable PYTHONWARNINGS="ignore::DeprecationWarning"
The `JsonLogger interface is deprecated in favor of the `ray.tune.json.JsonLoggerCallback` interface and will be removed in Ray 2.7.
self._loggers.append(cls(self.config, self.logdir, self.trial))
anaconda/envs/sddl/lib/python3.11/site-packages/ray/tune/logger/unified.py:53: RayDeprecationWarning: This API is deprecated and may be removed in future Ray releases. You could suppress this warning by setting env variable PYTHONWARNINGS="ignore::DeprecationWarning"
The `CSVLogger interface is deprecated in favor of the `ray.tune.csv.CSVLoggerCallback` interface and will be removed in Ray 2.7.
self._loggers.append(cls(self.config, self.logdir, self.trial))
anaconda/envs/sddl/lib/python3.11/site-packages/ray/tune/logger/unified.py:53: RayDeprecationWarning: This API is deprecated and may be removed in future Ray releases. You could suppress this warning by setting env variable PYTHONWARNINGS="ignore::DeprecationWarning"
The `TBXLogger interface is deprecated in favor of the `ray.tune.tensorboardx.TBXLoggerCallback` interface and will be removed in Ray 2.7.
self._loggers.append(cls(self.config, self.logdir, self.trial))
Versions / Dependencies
python=3.11
, ray==2.24.0
Reproduction script
import ray
from ray.rllib.algorithms.ppo import PPOConfig
ray.shutdown()
ray.init(runtime_env={"env_vars": {"PYTHONWARNINGS": "ignore::DeprecationWarning"}})
config = (
PPOConfig()
.environment("CartPole-v1")
.framework("torch")
.api_stack(
enable_rl_module_and_learner=True,
enable_env_runner_and_connector_v2=True,
)
.resources(
num_cpus_for_main_process=1,
)
.learners(
num_learners=0,
num_gpus_per_learner=0,
)
.training(model={"uses_new_env_runners": True})
)
algo = config.build()
Issue Severity
Low: It annoys or frustrates me.