Skip to content

Latest commit

 

History

History
68 lines (59 loc) · 2.59 KB

0.get_started.md

File metadata and controls

68 lines (59 loc) · 2.59 KB

Get Started

Installation

  1. clone this repo.

    git clone https://github.com/ShiqiYu/OpenGait.git
    
  2. Install dependenices:

    • pytorch >= 1.6
    • torchvision
    • pyyaml
    • tensorboard
    • opencv-python
    • tqdm
    • py7zr

    Install dependenices by Anaconda:

    conda install tqdm pyyaml tensorboard opencv py7zr
    conda install pytorch==1.6.0 torchvision -c pytorch
    

    Or, Install dependenices by pip:

    pip install tqdm pyyaml tensorboard opencv-python py7zr
    pip install torch==1.6.0 torchvision==0.7.0
    

Prepare dataset

See prepare dataset.

Get trained model

  • Option 1:
    python misc/download_pretrained_model.py
    
  • Option 2: Go to the release page, then download the model file and uncompress it to output.

Train

Train a model by

CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node=2 opengait/main.py --cfgs ./config/baseline/baseline.yaml --phase train
  • python -m torch.distributed.launch DDP launch instruction.
  • --nproc_per_node The number of gpus to use, and it must equal the length of CUDA_VISIBLE_DEVICES.
  • --cfgs The path to config file.
  • --phase Specified as train.
  • --log_to_file If specified, the terminal log will be written on disk simultaneously.

You can run commands in train.sh for training different models.

Test

Evaluate the trained model by

CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node=2 opengait/main.py --cfgs ./config/baseline/baseline.yaml --phase test
  • --phase Specified as test.
  • --iter Specify a iteration checkpoint.

Tip: Other arguments are the same as train phase.

You can run commands in test.sh for testing different models.

Customize

  1. Read the detailed config to figure out the usage of needed setting items;
  2. See how to create your model;
  3. There are some advanced usages, refer to advanced usages, please.

Warning

  • In DDP mode, zombie processes may be generated when the program terminates abnormally. You can use this command sh misc/clean_process.sh to clear them.