git clone https://github.com/ShiqiYu/OpenGait.git
Install dependenices:
Install dependenices by Anaconda:
conda install tqdm pyyaml tensorboard opencv kornia einops -c conda-forge
conda install pytorch==1.10 torchvision -c pytorch
Or, Install dependenices by pip:
pip install tqdm pyyaml tensorboard opencv-python kornia einops
pip install torch==1.10 torchvision==0.11
See prepare dataset.
python misc/download_pretrained_model.py
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.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.
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
--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.
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.