mmdetection
mmdetection copied to clipboard
Multi-GPU and CPU support
To run sample several envvars should be defined:
MASTER_PORT - required; has to be a free port on machine with rank 0 MASTER_ADDR - required (except for rank 0); address of rank 0 node WORLD_SIZE - required; can be set either here, or in a call to init function RANK - required; can be set either here, or in a call to init function
Single GPU example:
$ MASTER_ADDR=localhost MASTER_PORT=2000 WORLD_SIZE=1 RANK=0 CUDA_VISIBLE_DEVICES=0 python mmdet/apis/ote/sample/sample.py configs/ote/custom-object-detection/mobilenetV2_ATSS/template.yaml
Two GPUs example:
$ MASTER_ADDR=localhost MASTER_PORT=2000 WORLD_SIZE=2 RANK=1 CUDA_VISIBLE_DEVICES=0,1 python mmdet/apis/ote/sample/sample.py configs/ote/custom-object-detection/mobilenetV2_ATSS/template.yaml & $ MASTER_ADDR=localhost MASTER_PORT=2000 WORLD_SIZE=2 RANK=0 CUDA_VISIBLE_DEVICES=0,1 python mmdet/apis/ote/sample/sample.py configs/ote/custom-object-detection/mobilenetV2_ATSS/template.yaml