semitable / robotic-warehouse

Multi-Robot Warehouse (RWARE): A multi-agent reinforcement learning environment
MIT License
292 stars 69 forks source link

Import error #10

Open hsvgbkhgbv opened 2 years ago

hsvgbkhgbv commented 2 years ago

env = gym.make("rware-tiny-2ag-v1") Traceback (most recent call last): File "", line 1, in File "/home/jianhong/anaconda3/envs/mansa/lib/python3.7/site-packages/gym/envs/registration.py", line 676, in make return registry.make(id, kwargs) File "/home/jianhong/anaconda3/envs/mansa/lib/python3.7/site-packages/gym/envs/registration.py", line 520, in make return spec.make(kwargs) File "/home/jianhong/anaconda3/envs/mansa/lib/python3.7/site-packages/gym/envs/registration.py", line 140, in make env = cls(**_kwargs) File "/home/jianhong/anaconda3/envs/mansa/lib/python3.7/site-packages/rware/warehouse.py", line 247, in init self._use_slow_obs() File "/home/jianhong/anaconda3/envs/mansa/lib/python3.7/site-packages/rware/warehouse.py", line 359, in _use_slowobs for in range(self.nagents) File "/home/jianhong/anaconda3/envs/mansa/lib/python3.7/site-packages/rware/warehouse.py", line 359, in for in range(self.n_agents) File "/home/jianhong/anaconda3/envs/mansa/lib/python3.7/site-packages/gym/spaces/multi_binary.py", line 41, in init assert (np.asarray(input_n) > 0).all(), "n (counts) have to be positive" AssertionError: n (counts) have to be positiv

hsvgbkhgbv commented 2 years ago

I am not sure why this error would happen.

semitable commented 2 years ago

Hi! Could you try downgrading to gym==0.21 ? I think gym broke a few things (again). I'll get to fixing for the latest version soon, but for now please try pip install gym==0.21.0

aowen87 commented 2 years ago

I'm also encountering this issue. Any idea on an ETA for a fix?

semitable commented 2 years ago

@aowen87 Have you tried the solution above (downgrading to 0.21)?

aowen87 commented 2 years ago

@aowen87 Have you tried the solution above (downgrading to 0.21)?

Downgrading works, but I have some package dependencies that want a more recent version. It's not a big deal to remove the other packages for now. I'm just curious if there's an ETA for a longer term fix.

semitable commented 2 years ago

Gym seems to be aggressively changing their API recently and fixes seem to be short-lasting. I believe they will release a v1.0 soon which will stabilise their API. I will happily do a pass when they do, and fix any issues.

aowen87 commented 2 years ago

Sounds good. Thanks!