Open NDR008 opened 1 year ago
same error, no idea how to solve it....
Hey @quarkzou , you need to activate the "old stack" behavior by adding this to your config:
config.training(_enable_learner_api=False).rl_modules(_enable_rl_module_api=False)
Then you should be able to utilize your custom ModelV2 network w/o problems.
It's true what you say: Either you use a custom ModelV2, then you need to disable the new stack via the above config changes OR you use the new RLModule APIs (default for PPO, so no config changes required), but then your custom model must be a subclass of RLModule.
What happened + What you expected to happen
I tried to register a custom model.
But it seems that both with the default models or the custom model, RLlib thinks that I chose to _enable_rl_module_api=True
As a result: Cannot use
custom_model
option with RLModule API.custom_model
is part of the ModelV2 API and Policy API, which are not compatible with the RLModule API. You can either deactivate the RLModule API by settingconfig.rl_module( _enable_rl_module_api=False)
andconfig.training(_enable_learner_api=False)
,or use the RLModule API and implement your custom model as an RLModule.It seems much of the Docs for 2.7.0 no longer match with the default models and APIs that RLlib is using in the background.
2023-10-07 23:10:05,329 WARNING algorithm_config.py:2558 -- Setting `exploration_config={}` because you set `_enable_rl_module_api=True`. When RLModule API are enabled, exploration_config can not be set. If you want to implement custom exploration behaviour, please modify the `forward_exploration` method of the RLModule at hand. On configs that have a default exploration config, this must be done with `config.exploration_config={}`.
Versions / Dependencies
Windows 10 Ray 2.6.3 (I checked on Ray 2.7.0 just in case too
Reproduction script
Copy from RLlib ComplexInputNet
Issue Severity
Low: It annoys or frustrates me.