Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] spaces.Box ValueError: Some low values are greater than high #617

Closed
elliottower opened this issue Jul 18, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@elliottower
Copy link
Member

elliottower commented Jul 18, 2023

Describe the bug

Found when testing python 3.11 with other farama projects (supersuit in this case), but just tested with a new venv and gymnasium v29 and python3.11 and nothing else

https://github.com/Farama-Foundation/SuperSuit/actions/runs/5583348225/jobs/10203570526

Code example

from gymnasium import spaces
import numpy as np
spaces.Box(low=0, high=255, shape=[64, 64, 3], dtype=np.int8)
Traceback (most recent call last):
  File "/home/elliot/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_exec2.py", line 3, in Exec
    exec(exp, global_vars, local_vars)
  File "<input>", line 1, in <module>
  File "/home/elliot/anaconda3/envs/shimmy/lib/python3.11/site-packages/gymnasium/spaces/box.py", line 126, in __init__
    raise ValueError(
ValueError: Some low values are greater than high, low=[[[0 0 0]
  [0 0 0]
  [0 0 0]
  ...
  [0 0 0]
  [0 0 0]
  [0 0 0]]
 [[0 0 0]
  [0 0 0]
  [0 0 0]
  ...
  [0 0 0]
  [0 0 0]
  [0 0 0]]
 [[0 0 0]
  [0 0 0]
  [0 0 0]
  ...
  [0 0 0]
  [0 0 0]
  [0 0 0]]
 ...
 [[0 0 0]
  [0 0 0]
  [0 0 0]
  ...
  [0 0 0]
  [0 0 0]
  [0 0 0]]
 [[0 0 0]
  [0 0 0]
  [0 0 0]
  ...
  [0 0 0]
  [0 0 0]
  [0 0 0]]
 [[0 0 0]
  [0 0 0]
  [0 0 0]
  ...
  [0 0 0]
  [0 0 0]
  [0 0 0]]], high=[[[-1 -1 -1]
  [-1 -1 -1]
  [-1 -1 -1]
  ...
  [-1 -1 -1]
  [-1 -1 -1]
  [-1 -1 -1]]
 [[-1 -1 -1]
  [-1 -1 -1]
  [-1 -1 -1]
  ...
  [-1 -1 -1]
  [-1 -1 -1]
  [-1 -1 -1]]
 [[-1 -1 -1]
  [-1 -1 -1]
  [-1 -1 -1]
  ...
  [-1 -1 -1]
  [-1 -1 -1]
  [-1 -1 -1]]
 ...
 [[-1 -1 -1]
  [-1 -1 -1]
  [-1 -1 -1]
  ...
  [-1 -1 -1]
  [-1 -1 -1]
  [-1 -1 -1]]
 [[-1 -1 -1]
  [-1 -1 -1]
  [-1 -1 -1]
  ...
  [-1 -1 -1]
  [-1 -1 -1]
  [-1 -1 -1]]
 [[-1 -1 -1]
  [-1 -1 -1]
  [-1 -1 -1]
  ...
  [-1 -1 -1]
  [-1 -1 -1]
  [-1 -1 -1]]]


### System info

_No response_

### Additional context

_No response_

### Checklist

- [X] I have checked that there is no similar [issue](https://github.com/Farama-Foundation/Gymnasium/issues) in the repo
@elliottower elliottower added the bug Something isn't working label Jul 18, 2023
@elliottower
Copy link
Member Author

elliottower commented Jul 18, 2023

Oh it looks like this is just a poorly designed SuperSuit test cause they use np.int8 when it's a number larger than +-128. Testing different versions of Python it appears 3.10 has the same error, so I think it's just a new error that was added with V29 that may affect some backwards compatibility (which to be fair, you don't want to accidentally have your low values be larger than high values so it's a useful error)

@pseudo-rnd-thoughts
Copy link
Member

@elliottower I suspect it is meant to be uint8 as this would be a valid bound

@elliottower
Copy link
Member Author

@elliottower I suspect it is meant to be uint8 as this would be a valid bound

Ya makes sense just not int8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants