stable-baselines: CustomEnv Observation Shape Error

I am running into small issue with my observation space shape

        self.observation_space = spaces.Box(low=-np.inf, high=np.inf,shape=(6,),
                                           dtype=np.float32)

What do i need to modify to fix this issue.

Error with check_env is

AssertionError: The observation returned by the reset()method does not match the given observation space

Without check_env ValueError: Cannot feed value of shape (1, 14) for Tensor 'input/Ob:0', which has shape '(?, 6)'

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20

Most upvoted comments

I had try return np.array([0.0, 0.0]) but not work. But dtype=np.float64 works.

Can I ask you what the OBS is exactly?

I guess it’s their ‘observation’? 😃

Thanks your tips, I found that add dtype solved, but why?

image

Can I ask you what the OBS is exactly?

I had try return np.array([0.0, 0.0]) but not work. But dtype=np.float64 works.

yes, you are right. I use np.pi, even though float32 doesn’t work, but float64 works.

Yes, but at line 9, the first np.inf is missing a “-” in front of it 😃