CustomEnv Observation Shape Error
See original GitHub issueI 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)'
Issue Analytics
- State:
- Created 3 years ago
- Comments:19
Top Results From Across the Web
Error while defining observation space in gym custom ...
When you define custom env in gym, check_env checks several things. In this case, observation.isinstance(observation_space) is not passed.
Read more >Vectorized Environments - Stable Baselines - Read the Docs
In the case of non-array observation spaces such as Dict or Tuple , where different sub-spaces may have different shapes, the sub-observations are...
Read more >Stable Baselines3 Tutorial - Creating a custom Gym ...
First steps with the gym interface · observation_space which one of the gym spaces ( Discrete , Box , ...) and describe the...
Read more >Stable Baselines Documentation - Read the Docs
always normalize your observation space when you can, i.e., ... Verifies the tensors match the given shape, will raise an error if the ......
Read more >[RL] Create Environment 만들 때 참고 - All I Need Is Data.
super(CustomEnv, self).__init__() # Define action and observation space # They must be gym.spaces objects # Example when using discrete ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had try
return np.array([0.0, 0.0])
but not work. Butdtype=np.float64
works.Thanks your tips, I found that add
dtype
solved, but why?