Gobigger Explore For Python

Overview

Gobigger-Explore

🔮 GoBigger Challenge 2021 Baseline

en/中文

🤖 Introduction

This is the baseline of GoBigger Multi-Agent Decision Intelligence Challenge in 2021. The baseline is based on OpenDILab and aims to provide a simple entry-level method. Participants can build agents by extending the baseline method provided. In addition, Opendilab's modular structure allows participants to easily get started, and it provides a wealth of reinforcement learning algorithms for participants to use. This baseline is a good starting point, especially for entry-level researchers who are familiar with multi-agent decision AI problems.

🚀 Release Version

The current version is the latest version v-0.2.0.

  1. What needs to be optimized in the future
    • Variable length features lead to potential GPU memory explosion risk.
    • Better reward function design.
  2. Version-0.2.0
    • Fix the ckpt bug to improve the accuracy of the evaluator.
    • Fix replay_buffer bug
    • Brand new feature engineering to improve convergence speed.
    • Replay_buffer stores variable-length features to improve data utilization and training speed.
  3. Version-0.1.0

👇 Getting Started

  1. System environment

    • Core 16
    • GPU A100(40G)
    • Memory 50G
  2. Baseline Config

    • The default config is the config used in this experiment. Participants can modify it according to the system environment.
    • The size of replay_buffer_size needs to be set according to the size of RAM.
    • The size of batch_size needs to be set according to the size of the GPU memory.
  3. Install the necessary packege

    # Install DI-engine
    git clone https://github.com/opendilab/DI-engine.git
    cd YOUR_PATH/DI-engine/
    pip install -e . --user

    # Install Env Gobigger
    git clone https://github.com/opendilab/GoBigger.git
    cd YOUR_PATH/GoBigger/
    pip install -e . --user
  1. Start training
    # Download baseline
    git clone https://github.com/opendilab/Gobigger-Explore.git
    cd my_submission/entry/
    python gobigger_vsbot_baseline_main.py
  1. Evaluator and Save game videos
    cd my_submission/entry/
    python gobigger_vsbot_baseline_eval.py --ckpt YOUR_CKPT_PATH

🎯 Result

We released training log information, checkpoints, and evaluation videos. Below is the download link,

  • Baidu Netdisk Link
    • Extraction code: u4i6
  • Google Drive Link

😍 Resources

You might also like...
PSP (Python Starter Package) is meant for those who want to start coding in python but are new to the coding scene.

Python Starter Package PSP (Python Starter Package) is meant for those who want to start coding in python, but are new to the coding scene. We include

Py-Parser est un parser de code python en python encore en plien dévlopement.

PY - PARSER Py-Parser est un parser de code python en python encore en plien dévlopement. Une fois achevé, il servira a de nombreux projets comme glad

Simple, high-school-leveled sequence library written in Python / 간단한 고등학교 수준 수열 라이브러리 (Python)
A community based economy bot with python works only with python 3.7.8 as web3 requires cytoolz

A community based economy bot with python works only with python 3.7.8 as web3 requires cytoolz has some issues building with python 3.10

A python script based on OpenCV-Python, you can automatically hang up the Destiny 2 Throne to get the Dawning  Essence.
A python script based on OpenCV-Python, you can automatically hang up the Destiny 2 Throne to get the Dawning Essence.

A python script based on OpenCV-Python, you can automatically hang up the Destiny 2 Throne to get the Dawning Essence.

Run python scripts and pass data between multiple python and node processes using this npm module

Run python scripts and pass data between multiple python and node processes using this npm module. process-communication has a event based architecture for interacting with python data and errors inside nodejs.

inverted pendulum fuzzy control python code (python 2.7.18)
inverted pendulum fuzzy control python code (python 2.7.18)

inverted-pendulum-fuzzy-control- inverted pendulum fuzzy control python code (python 2.7.18) We have 3 general functions for 3 main steps: fuzzificati

Izy - Python functions and classes that make python even easier than it is

izy Python functions and classes that make it even easier! You will wonder why t

Msgpack serialization/deserialization library for Python, written in Rust using PyO3 and rust-msgpack. Reboot of orjson. msgpack.org[Python]

ormsgpack ormsgpack is a fast msgpack library for Python. It is a fork/reboot of orjson It serializes faster than msgpack-python and deserializes a bi

Comments
  • typeerros when i run 'python gobigger_vsbot_baseline_main.py'

    typeerros when i run 'python gobigger_vsbot_baseline_main.py'

    pygame 2.1.0 (SDL 2.0.16, Python 3.7.9)
    Hello from the pygame community. https://www.pygame.org/contribute.html
    INFO:learner_logger:[RANK0]: DI-engine DRL Policy
    GoBiggerHybridActionSimple(
      (activation): ReLU()
      (encoder): StructedGcnConvSimple(
        (scalar_encoder): Sequential(
          (0): Linear(in_features=5, out_features=32, bias=True)
          (1): ReLU()
          (2): Linear(in_features=32, out_features=128, bias=True)
          (3): ReLU()
        )
        (food_encoder): Sequential(
          (0): Conv2d(2, 32, kernel_size=(5, 5), stride=(4, 4), padding=(2, 2))
          (1): ReLU()
          (2): Conv2d(32, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
          (3): ReLU()
          (4): Conv2d(64, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
          (5): ReLU()
          (6): Conv2d(64, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
          (7): ReLU()
          (8): Conv2d(128, 128, kernel_size=(1, 1), stride=(1, 1))
          (9): ReLU()
        )
        (food_relation_encoder): Sequential(
          (0): Linear(in_features=150, out_features=64, bias=True)
          (1): ReLU()
          (2): Linear(in_features=64, out_features=128, bias=True)
          (3): ReLU()
        )
        (thorn_relation_encoder): Sequential(
          (0): Linear(in_features=12, out_features=32, bias=True)
          (1): ReLU()
          (2): Linear(in_features=32, out_features=128, bias=True)
          (3): ReLU()
        )
        (clone_encoder): Sequential(
          (0): Linear(in_features=17, out_features=32, bias=True)
          (1): ReLU()
          (2): Linear(in_features=32, out_features=128, bias=True)
          (3): ReLU()
        )
        (clone_relation_encoder): Sequential(
          (0): Linear(in_features=12, out_features=32, bias=True)
          (1): ReLU()
          (2): Linear(in_features=32, out_features=128, bias=True)
          (3): ReLU()
        )
        (gcn_1): RelationGCN(
          (act): ReLU()
          (thorn_relation_layers): Sequential(
            (0): Linear(in_features=256, out_features=128, bias=True)
            (1): ReLU()
          )
          (clone_relation_layers): Sequential(
            (0): Linear(in_features=384, out_features=128, bias=True)
            (1): ReLU()
          )
          (agg_relation_layers): Sequential(
            (0): Linear(in_features=512, out_features=128, bias=True)
            (1): ReLU()
          )
        )
        (gcn_2): RelationGCN(
          (act): ReLU()
          (thorn_relation_layers): Sequential(
            (0): Linear(in_features=256, out_features=128, bias=True)
            (1): ReLU()
          )
          (clone_relation_layers): Sequential(
            (0): Linear(in_features=384, out_features=128, bias=True)
            (1): ReLU()
          )
          (agg_relation_layers): Sequential(
            (0): Linear(in_features=512, out_features=128, bias=True)
            (1): ReLU()
          )
        )
        (agg_encoder): Sequential(
          (0): Linear(in_features=384, out_features=128, bias=True)
          (1): ReLU()
          (2): Linear(in_features=128, out_features=64, bias=True)
          (3): ReLU()
        )
      )
      (action_type_head): DiscreteHead(
        (Q): Sequential(
          (0): Sequential(
            (0): Linear(in_features=32, out_features=32, bias=True)
            (1): ReLU()
            (2): Linear(in_features=32, out_features=32, bias=True)
            (3): ReLU()
          )
          (1): Sequential(
            (0): Linear(in_features=32, out_features=16, bias=True)
          )
        )
      )
    )
    Traceback (most recent call last):
      File "/home/keliangjun666/hjb/Gobigger-Explore/my_submission/entry/gobigger_vsbot_baseline_simple_main.py", line 112, in <module>
        main(main_config)
      File "/home/keliangjun666/hjb/Gobigger-Explore/my_submission/entry/gobigger_vsbot_baseline_simple_main.py", line 99, in main
        learner.save_checkpoint, learner.train_iter, collector.envstep
      File "/home/keliangjun666/miniconda3/envs/big/lib/python3.7/site-packages/ding/worker/collector/battle_interaction_serial_evaluator.py", line 206, in eval
        obs = to_tensor(obs, dtype=torch.float32)
      File "/home/keliangjun666/miniconda3/envs/big/lib/python3.7/site-packages/ding/torch_utils/data_helper.py", line 109, in to_tensor
        new_data[k] = to_tensor(v, dtype, ignore_keys, transform_scalar)
      File "/home/keliangjun666/miniconda3/envs/big/lib/python3.7/site-packages/ding/torch_utils/data_helper.py", line 121, in to_tensor
        new_data.append(to_tensor(t, dtype, ignore_keys, transform_scalar))
      File "/home/keliangjun666/miniconda3/envs/big/lib/python3.7/site-packages/ding/torch_utils/data_helper.py", line 109, in to_tensor
        new_data[k] = to_tensor(v, dtype, ignore_keys, transform_scalar)
      File "/home/keliangjun666/miniconda3/envs/big/lib/python3.7/site-packages/ding/torch_utils/data_helper.py", line 121, in to_tensor
        new_data.append(to_tensor(t, dtype, ignore_keys, transform_scalar))
      File "/home/keliangjun666/miniconda3/envs/big/lib/python3.7/site-packages/ding/torch_utils/data_helper.py", line 109, in to_tensor
        new_data[k] = to_tensor(v, dtype, ignore_keys, transform_scalar)
      File "/home/keliangjun666/miniconda3/envs/big/lib/python3.7/site-packages/ding/torch_utils/data_helper.py", line 121, in to_tensor
        new_data.append(to_tensor(t, dtype, ignore_keys, transform_scalar))
      File "/home/keliangjun666/miniconda3/envs/big/lib/python3.7/site-packages/ding/torch_utils/data_helper.py", line 109, in to_tensor
        new_data[k] = to_tensor(v, dtype, ignore_keys, transform_scalar)
      File "/home/keliangjun666/miniconda3/envs/big/lib/python3.7/site-packages/ding/torch_utils/data_helper.py", line 109, in to_tensor
        new_data[k] = to_tensor(v, dtype, ignore_keys, transform_scalar)
      File "/home/keliangjun666/miniconda3/envs/big/lib/python3.7/site-packages/ding/torch_utils/data_helper.py", line 109, in to_tensor
        new_data[k] = to_tensor(v, dtype, ignore_keys, transform_scalar)
      File "/home/keliangjun666/miniconda3/envs/big/lib/python3.7/site-packages/ding/torch_utils/data_helper.py", line 121, in to_tensor
        new_data.append(to_tensor(t, dtype, ignore_keys, transform_scalar))
      File "/home/keliangjun666/miniconda3/envs/big/lib/python3.7/site-packages/ding/torch_utils/data_helper.py", line 115, in to_tensor
        return transform(item)
      File "/home/keliangjun666/miniconda3/envs/big/lib/python3.7/site-packages/ding/torch_utils/data_helper.py", line 101, in transform
        return torch.tensor(d, dtype=dtype)
    TypeError: must be real number, not str
    

    how i can slove this error

    opened by notomatoes 1
  • when I use Multi-GPUs to train my model,RuntimeError: Caught RuntimeError in replica 0 on device 0

    when I use Multi-GPUs to train my model,RuntimeError: Caught RuntimeError in replica 0 on device 0

    When I test the DP mode ,the error happened image

    Refer to the https://di-engine-docs.readthedocs.io/zh_CN/latest/best_practice/multi_gpu_example.html, I changed the file: (1)gobigger_no_spatial_config.py image (2)gobigger_vsbot_baseline_simple_main.py image

    opened by temporaryforijcai 1
  • How to speed up?

    How to speed up?

    Hi, nice baseline repo! Your log of v0.3 shows that it takes more than 3 days to train this model. I have tried to use ddp to speed up the training process but still not satisfied. Do you have any suggestion for speeding the training process up in a multi-gpu and high-memory machine? Any useful params to share?

    opened by applenob 1
Owner
OpenDILab
Open sourced Decision Intelligence (DI)
OpenDILab
Explore related sequences in the OEIS

OEIS explorer This is a tool for exploring two different kinds of relationships between sequences in the OEIS: mentions (links) of other sequences on

Alex Hall 6 Mar 15, 2022
A project to explore and provide useful code for Mango Markets

?? Mango Explorer A project to explore and provide useful code for Mango Markets

Blockworks Foundation 160 Dec 19, 2022
An interactive tool with which to explore the possible imaging performance of candidate ngEHT architectures.

ngEHTexplorer An interactive tool with which to explore the possible imaging performance of candidate ngEHT architectures. Welcome! ngEHTexplorer is a

Avery Broderick 7 Jan 28, 2022
A turtlebot auto controller allows robot to autonomously explore environment.

A turtlebot auto controller allows robot to autonomously explore environment.

Yuliang Zhong 1 Nov 10, 2021
Todos os exercícios do Curso de Python, do canal Curso em Vídeo, resolvidos em Python, Javascript, Java, C++, C# e mais...

Exercícios - CeV Oferecido por Linguagens utilizadas atualmente O que vai encontrar aqui? ?? Esse repositório é dedicado a armazenar todos os enunciad

Coding in Community 43 Nov 10, 2022
PyDy, short for Python Dynamics, is a tool kit written in the Python

PyDy, short for Python Dynamics, is a tool kit written in the Python programming language that utilizes an array of scientific programs to enable the study of multibody dynamics. The goal is to have a modular framework and eventually a physics abstraction layer which utilizes a variety of backends that can provide the user with their desired workflow

PyDy 307 Jan 1, 2023
A Python script made for the Python Discord Pixels event.

Python Discord Pixels A Python script made for the Python Discord Pixels event. Usage Create an image.png RGBA image with your pattern. Transparent pi

Stanisław Jelnicki 4 Mar 23, 2022
this is a basic python project that I made using python

this is a basic python project that I made using python. This project is only for practice because my python skills are still newbie.

Elvira Firmansyah 2 Dec 14, 2022
Analisador de strings feito em Python // String parser made in Python

Este é um analisador feito em Python, neste programa, estou estudando funções e a sua junção com "if's" e dados colocados pelo usuário. Neste código,

Dev Nasser 1 Nov 3, 2021
Python with braces. Because Python is awesome, but whitespace is awful.

Bython Python with braces. Because Python is awesome, but whitespace is awful. Bython is a Python preprosessor which translates curly brackets into in

null 1 Nov 4, 2021