Coder Social home page Coder Social logo

bridge-torch's Introduction

Pytorch BC/RL Implementations for BridgeData V2

This repository provides distributed training code (based on Deepspeed) for BridgeData V2. Since most open-source LLMs are implemented with Pytorch and require memory-efficient distributed training frameworks to fine-tune, we believe this repository can facilitate the application of Multimodal LLMs on this field.

We provide implementations for the following methods:

  • Visual goal-conditioned BC
  • RT-1 (TODO)
  • A novel generative vision-language-action model (TODO)

Environment

The dependencies for this codebase can be installed in a conda environment:

pip install -r requirements.txt

Data

The raw dataset (comprised of JPEGs, PNGs, and pkl files) can be downloaded from the website. For training, first use data_processing/bridgedata_raw_to_numpy.py to convert the raw data into numpy files; then use data_processing/bridgedata_numpy_split.py to convert the numpy files into trajectory-level pickle files.

Training

To start training run the command below.

deepspeed src/train.py \
    --steps 300000 \
    --warmup_steps 10000 \
    --save_dir gc_bc_save \
    --run_name gd_bc \
    --random_seed 42

Hyperparameters can be modified in src/config.py. The training log is expected to look like train.log.

Evaluation

First, set up the robot hardware according to the official guide. Install the WidowX robot controller stack from the official repo. Then, run the command:

python src/eval.py \
    --num_timesteps NUM_TIMESTEPS \
    --video_save_path VIDEO_DIR \
    --checkpoint_path gc_bc_save/190000/mp_rank_00_model_states.pt \
    --config_path  gc_bc_save/config.json \
    --blocking

The script loads cofiguration of the checkpoint from a json file in save_dir (e.g., gc_bc_save) output by train.py.

We will be grateful if you can report your reproduced results on an issue.

Provided Checkpoints

Checkpoints for GCBC are available here.

Acknowledgement

This code mimics the official JAX implementation, while being more compact and easier to follow.

bridge-torch's People

Contributors

stardust-hyx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.