IDEA-Research / DAB-DETR

[ICLR 2022] Official implementation of the paper "DAB-DETR: Dynamic Anchor Boxes are Better Queries for DETR"
Apache License 2.0
517 stars 87 forks source link

can i train dab-deformable-detr with multi-gpu in one machine? #33

Closed nvilli closed 2 years ago

nvilli commented 2 years ago

i've tried to train dab-deformable-detr with multi-gpus in one ubuntu server by using 'torch.nn.Parallel', but a runtime error raised which is "Expected tensor for augment #1 'input' to have the same device as tensor for argument #2 'weight'; but device 0 does not equal 1(while checking arguments for cudnn_convolution)". Is this a bug? Or there is any other way to train dab-deformable-detr with multi-gpus?

lebionick commented 2 years ago

why don't you use training script from the repo?

# for dab_deformable_detr: 48.1 AP
python -m torch.distributed.launch --nproc_per_node=8 \
  main.py -m dab_deformable_detr \
  --output_dir logs/dab_deformable_detr/R50 \
  --batch_size 2 \
  --epochs 50 \
  --lr_drop 40 \
  --transformer_activation relu \
  --coco_path /path/to/your/COCODIR

it worked for me

SlongLiu commented 2 years ago

Thanks for the reply of @lebionick. It is the correct answer to the question.