Stable-baselines: "Error: the action space must be a vector" error is not included in the env_checker

Created on 18 Apr 2020  路  3Comments  路  Source: hill-a/stable-baselines

The following assertion which checks if the action-space is a vector or not is not included in the env_checker script but returns an error during the runtime:

    if isinstance(ac_space, spaces.Box):
        assert len(ac_space.shape) == 1, "Error: the action space must be a vector"
        return DiagGaussianProbabilityDistributionType(ac_space.shape[0])

the mentioned is on common/distributions.py and def make_prob_dist_type(): function line 486-488.

bug

Most helpful comment

A PR to add this and update env_checker would be welcomed :)

It would be a warning as it is specific to Stable Baselines. But yes, I forgot that one.

All 3 comments

Good catch. I would also update assertion to be more informative. It seems to make sure you do not use an Box space with multiple axis. I was bit confused about "must being a vector", and thought it checks if the shape is scalar.

A PR to add this and update env_checker would be welcomed :)

A PR to add this and update env_checker would be welcomed :)

It would be a warning as it is specific to Stable Baselines. But yes, I forgot that one.

@Miffyli @araffin
sure! I will add the PR.

Was this page helpful?
0 / 5 - 0 ratings