mini-AlphaStar: IndexError
It is very exciting to see the implementation of Alphastar after 2 years since release of the paper. I am trying to run miniAlphaStar. But after a few tries I am stuck at an error. Could you give me some help?
Steps I take:
- install the environment with “conda create -n th_1_5 python=3.7 pytorch=1.5 -c pytorch”, “conda activate th_1_5” and “pip install -r requirements.txt”. conda version 4.8.2.
- download StarCraft from “http://blzdistsc2-a.akamaihd.net/Linux/SC2.4.6.0.67926.zip” in page “https://github.com/Blizzard/s2client-proto” and unzip to ~/
- download all maps from “https://github.com/Blizzard/s2client-proto” and move them to ~/StarCraftII/Maps/
- download replays with command "python download_replays.py --key=mykey --secret=mysecrete --version=“4.6.0” --download_dir=./download/download-4-6 --extract --replays_dir=./replay/replay-4-6 --filter_version=“delete”
- make a soft link “data/Replays/filtered_replays_1/” to “replay/replay-4-6”
- change line 71 of mini-AlphaStar/alphastarmini/core/sl/transform_replay_data.py from “flags.DEFINE_string(“replay_version”, “3.16.1”, “the replays released by blizzard are all 3.16.1 version”)” to “flags.DEFINE_string(“replay_version”, “4.6.0”, “the replays released by blizzard are all 4.1.2 version”)”
- change “flags.DEFINE_string(“no_server_replay_path”, “D:/work/gitproject/mini-AlphaStar/data/Replays/small_simple64_replays/”, “path of replay data”)” to “flags.DEFINE_string(“no_server_replay_path”, “/home/user/Project/mini-AlphaStar/scripts/download_replay/third/replay/replay-4-6/”, “path of replay data”)”
then “python run.py”
but I got following error:
0%| | 10/60474 [00:29<19:04:31, 1.14s/it]Traceback (most recent call last):
File "/home/ats/Project/mini-AlphaStar/alphastarmini/core/sl/transform_replay_data.py", line 493, in test
feature, label = getFeatureAndLabel_numpy(obs, func_call)
File "/home/ats/Project/mini-AlphaStar/alphastarmini/core/sl/transform_replay_data.py", line 135, in getFeatureAndLabel_numpy
s = Agent.get_state_and_action_from_pickle_numpy(obs)
File "/home/ats/Project/mini-AlphaStar/alphastarmini/core/arch/agent.py", line 95, in get_state_and_action_from_pickle_numpy
batch_entities_tensor = Agent.preprocess_state_entity_numpy(obs)
File "/home/ats/Project/mini-AlphaStar/alphastarmini/core/arch/agent.py", line 355, in preprocess_state_entity_numpy
entities_array = ArchModel.preprocess_entity_numpy(e_list)
File "/home/ats/Project/mini-AlphaStar/alphastarmini/core/arch/arch_model.py", line 88, in preprocess_entity_numpy
return EntityEncoder.preprocess_numpy(e_list)
File "/home/ats/Project/mini-AlphaStar/alphastarmini/core/arch/entity_encoder.py", line 111, in preprocess_numpy
return cls.preprocess_in_numpy(entity_list)
File "/home/ats/Project/mini-AlphaStar/alphastarmini/core/arch/entity_encoder.py", line 524, in preprocess_in_numpy
order_queue_length_encoding = L.np_one_hot(np.array([order_queue_length]), cls.max_order_queue_length).reshape(1, -1)
File "/home/ats/Project/mini-AlphaStar/alphastarmini/lib/utils.py", line 280, in np_one_hot
res = np.eye(nb_classes)[np.array(targets).reshape(-1)]
IndexError: index 9 is out of bounds for axis 0 with size 9```
Firstly I tried Starcraft 4.1.2, but there is a pysc2 websocket timeout issue. Then I tried 4.6. The websocket timeout issue is gone but this index out of bound error arises.
My OS is ubuntu 20.04.3.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 24 (7 by maintainers)
I created a docker for testing this repo. Please check mini-alphastar docker.
I updated the image(around 28G). You can find Dockerfile in the “Overview” tag.
Docker can easily be deployed on cpu/gpu server or on k8s cluster.
If you find any problem please let me know.