cp-vton-plus icon indicating copy to clipboard operation
cp-vton-plus copied to clipboard

train.py is using cpu instead of gpu

Open iamnaazib opened this issue 4 years ago • 7 comments
trafficstars

after I started the train.py with this command:

python train.py --name GMM --stage GMM --workers 1 --save_count 5000 --shuffle

and after 1000 steps, this is the cpu and gpu usage:

image

what can I do to solve this? I want to train using my gpu

iamnaazib avatar Jun 17 '21 17:06 iamnaazib

@iamnaazib , you can add your gpu id(s) here: https://github.com/minar09/cp-vton-plus/blob/master/train.py#L21 as parser.add_argument("--gpu_ids", default="0") or add the argument in the run command: python train.py --name GMM --stage GMM --workers 1 --save_count 5000 --shuffle --gpu_ids 0

minar09 avatar Jun 19 '21 04:06 minar09

@iamnaazib , you can add your gpu id(s) here: https://github.com/minar09/cp-vton-plus/blob/master/train.py#L21 as parser.add_argument("--gpu_ids", default="0") or add the argument in the run command: python train.py --name GMM --stage GMM --workers 1 --save_count 5000 --shuffle --gpu_ids 0

I did that but its still using cpu idk why its doing that. A single image is taking 3-4 hours to train. Can I know which hardware you used to train your dataset??

iamnaazib avatar Jun 21 '21 09:06 iamnaazib

@iamnaazib, please check your GPU drivers and environments maybe. We used TITAN Xp GPUs for our experiments.

minar09 avatar Jun 25 '21 11:06 minar09

have checked and there doesn't seem to be any issue with the drivers and environments

iamnaazib avatar Jun 25 '21 14:06 iamnaazib

could you still tell me what are the driver and environment requirements for a nvidia graphics card to run this training

iamnaazib avatar Jun 25 '21 14:06 iamnaazib

the gpu spikes to 100% usage at the start but doesn't get used anymore

iamnaazib avatar Jun 25 '21 14:06 iamnaazib

I think you can first check if pytorch can access your gpus. For example, please check this: https://stackoverflow.com/questions/48152674/how-to-check-if-pytorch-is-using-the-gpu or this: https://discuss.pytorch.org/t/torch-cuda-is-available-is-true-while-i-am-using-the-gpu/29470

minar09 avatar Jun 26 '21 02:06 minar09