question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:

  1. 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.
  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 ~/
  3. download all maps from “https://github.com/Blizzard/s2client-proto” and move them to ~/StarCraftII/Maps/
  4. 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”
  5. make a soft link “data/Replays/filtered_replays_1/” to “replay/replay-4-6”
  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”)”
  7. 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:closed
  • Created 2 years ago
  • Comments:24 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
cloneniucommented, Dec 1, 2021

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.

0reactions
liuruozecommented, Jan 24, 2022

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found