jd730 / OICR-pytorch

Pytorch Implementation of Multiple Instance Detection Network with Online Instance Classifier Refinement
MIT License
75 stars 10 forks source link

About Multi GPU and Training Time #11

Closed UT-Mao closed 5 years ago

UT-Mao commented 5 years ago

CUDA_VISIBLE_DEVICES=1,2 python3 trainval_net.py --dataset pascal_voc --net vgg16 --bs 2 --nw 4 --save_dir='output' --model='oicr' --lr 0.001 --cuda --disp_interval 50 --mGPUs --vis --checkpoint_interval=500

I ran this, but it seems that only one GPU ( GPU 1 ) been used ( without any errors or warnings )and it takes about 300s per 50 iterations. My environment is CUDA 8.0, Python 3.5 and Pytorch 0.4.0

jd730 commented 5 years ago

@Moukahou I apologize for your experience. As I mentioned on Notice Section on Readme, bs==2 means it uses one GPU since following Caffe's batch system, the model forwards inputs twice and then backward at once. If you set bs as 4, it will be okay.

UT-Mao commented 5 years ago

Thank you for your answer!