2.9 KiB
2.9 KiB
Get Started
Installation
-
clone this repo.
git clone https://github.com/ShiqiYu/OpenGait.git -
Install dependenices:
- pytorch >= 1.10
- torchvision
- pyyaml
- tensorboard
- opencv-python
- tqdm
- py7zr
- kornia
- einops
Install dependenices by Anaconda:
conda install tqdm pyyaml tensorboard opencv kornia einops -c conda-forge conda install pytorch==1.10 torchvision -c pytorchOr, Install dependenices by pip:
pip install tqdm pyyaml tensorboard opencv-python kornia einops pip install torch==1.10 torchvision==0.11
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 ./configs/baseline/baseline.yaml --phase train
python -m torch.distributed.launchDDP launch instruction.--nproc_per_nodeThe number of gpus to use, and it must equal the length ofCUDA_VISIBLE_DEVICES.--cfgsThe path to config file.--phaseSpecified astrain.
--log_to_fileIf specified, the terminal log will be written on disk simultaneously.
You can run commands in train.sh for training different models.
For long-running local jobs, prefer the supervised systemd-run --user workflow documented in systemd-run-training.md. It uses torchrun, UUID-based GPU selection, real log files, and survives shell/session teardown more reliably than nohup ... &.
Test
Evaluate the trained model by
CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node=2 opengait/main.py --cfgs ./configs/baseline/baseline.yaml --phase test
--phaseSpecified astest.--iterSpecify a iteration checkpoint.
Tip: Other arguments are the same as train phase.
You can run commands in test.sh for testing different models.
Customize
- Read the detailed config to figure out the usage of needed setting items;
- See how to create your model;
- There are some advanced usages, refer to advanced usages, please.
Warning
- In
DDPmode, zombie processes may be generated when the program terminates abnormally. You can use this command sh misc/clean_process.sh to clear them.