Stable-Baselines-Team / stable-baselines3-contrib

Contrib package for Stable-Baselines3 - Experimental reinforcement learning (RL) code
https://sb3-contrib.readthedocs.io
MIT License
462 stars 169 forks source link

[Bug]: Is sb3_contrib/common/maskable/utils.py the cause of "WARN: env.action_masks to get variables from other wrappers is deprecated and will be removed in v1.0"? #256

Open mkbg8 opened 3 weeks ago

mkbg8 commented 3 weeks ago

🐛 Bug

This might be an issue which could cause problems in the future I guess. As far as I can see utils.py has been last touched 4y ago.

When running training on an InvalidActionEnvDiscrete-based environment I get this:

/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/gymnasium/core.py:311: UserWarning: WARN: env.action_masks to get variables from other wrappers is deprecated and will be removed in v1.0, to get this variable you can do env.unwrapped.action_masks for environment variables or env.get_wrapper_attr('action_masks') that will search the reminding wrappers.

To Reproduce

I have a minimal env inheriting from InvalidActionEnvDiscrete, which defines/implements action_masks. The above warning is given by Gymnasium when training.

Relevant log output / Error message

No response

System Info

installed with pip, everything up-to-date (2.4.0.a8). gym is @ 0.26.2 and gymnasium @ 0.29.1

Checklist

araffin commented 3 weeks ago

Related to https://github.com/DLR-RM/stable-baselines3/pull/1837