IndexError
See original GitHub issueIt 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.
Issue Analytics
- State:
- Created 2 years ago
- Comments:24 (7 by maintainers)
Top Results From Across the Web
Built-in Exceptions — Python 3.11.1 documentation
The base class for the exceptions that are raised when a key or index used on a mapping or sequence is invalid: IndexError...
Read more >Index Errors – Python Principles
An IndexError means that your code is trying to access an index that is invalid. This is usually because the index goes out...
Read more >Complete Guide to Python IndexError with Exampels - eduCBA
IndexError is one of the built-in exceptions that occur in an application when an index of the list is referenced and that index...
Read more >IndexError in Python - PythonForBeginners.com
IndexError is an exception in python that occurs when we try to access an element from a list or tuple from an index...
Read more >Python IndexError: List Index Out of Range Error Explained
The IndexError is one of the most common Python runtime errors that you'll encounter in your programming journey. For the most part, ...
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 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.
Hi,
if there are no more things to discuss, I will close the issue now.
For new things (or new problems) to discuss, we can open a new issue to discuss.
Thank you!