I have a 2 GPUs so I want to use data parallelism
. In my prototype I build a method within the model itself so I can call model.dosomething()
, this works if I only use 1 gpu E.g. using model.cuda()
. Now that my model is done testing I want to utilize the power of 2 GPUs. I can no longer do model.dosomething()
because model is now a type of <class 'torch.nn.parallel.data_parallel.DataParallel'>
. How can I remedy this beside rewrite the entire model again?
Do model.module.something()