Closed vadim0x60 closed 2 years ago
Hello, I would say that infinity does not exist in the real world, so in practice, you will always have a lower and upper bound (be it large) that you should be able to specify. Anyway, as mentioned in our documentation (see tips and tricks section), we do not recommend un-normalized action spaces (the env checker will warn you about that).
ValueError("Unsupported action space: make sure your Box space has a finite lower and upper bound")
I do agree, we would appreciate a PR that solves this issue and updates the env checker that currently only outputs a warning.
I wonder if the SB3 core code should raise an exception for this situation, as env checker is not explicitly required to run agents. If indeed setting inf
in Box space results in nans/invalid values, it should be safe-guarded with an informative exception, in my opinion.
Bug, feature, reasonable design choice - underline your opinion
The RL algorithms implemented in
stable-baselines3
do not support unbounded action spaces, i.e.🐛 Definitely a Bug
When someone attempts using stable-baselines on an environment with an unbounded action space, the failure happens silently. There is no error of any kind as the "learning" goes on for however many timesteps you have specified, the only problem is that all tensors in the resulting neural networks become
float('nan')
tensors. I also have not found it mentioned explicitly anywhere in the documentation, so the user has no way to learn that they are using an unsupported environment until many steps into the training and even then it takes some debugging to figure out what was the reason.To Reproduce
Expected behavior
Either:
(42 is used to represent 'some number' without loss of generality)
Or:
System Info
Additional context
This hints, of course, at a much bigger issue in the field of Reinforcement Learning that there is implicit knowledge like "unbounded action spaces are technically allowed by gym, but they aren't a thing in modern RL methods" that exists in everyone's heads, but not in the documentation of our tools.
Checklist