Farama-Foundation / MicroRTS-Py

A simple and highly efficient RTS-game-inspired environment for reinforcement learning (formerly Gym-MicroRTS)
MIT License
234 stars 45 forks source link

Issue with hello_world.py in actions.reshape() #77

Closed Neos-codes closed 2 years ago

Neos-codes commented 2 years ago

Hi! I'm learning how to use microRTS, but i can't run the example "hello_world.py" due the following error:

[ 6 4 4 4 4 7 49] 0 Traceback (most recent call last): File "hello_world.py", line 70, in nextobs, reward, done, info = envs.step(action) File "/home/neos/.local/lib/python3.8/site-packages/gym_microrts/envs/vec_env.py", line 190, in step self.stepasync(ac) File "/home/neos/.local/lib/python3.8/site-packages/gym_microrts/envs/vec_env.py", line 168, in step_async actions = actions.reshape((self.num_envs, self.width * self.height, -1)) ValueError: cannot reshape array of size 1792 into shape (3,256,newaxis)

Do you know this error occurs? Thanks!

vwxyzjn commented 2 years ago

Sorry you are running into this issue. Could you check if you can run the `hello_world.py in https://github.com/vwxyzjn/gym-microrts/pull/71? We will add a test case for this to ensure this never happens again.

vwxyzjn commented 2 years ago

Specifically this:

https://github.com/vwxyzjn/gym-microrts/blob/6d3644bbd1b4564ec8091bf8d37cd2983daadff3/hello_world.py#L1-L62

Neos-codes commented 2 years ago

Sorry you are running into this issue. Could you check if you can run the `hello_world.py in #71? We will add a test case for this to ensure this never happens again.

It works perfect! Thanks!