open-reid icon indicating copy to clipboard operation
open-reid copied to clipboard

why convert the Variable(imgs) to [Variable(imgs)] (it makes more complicated) and without .cuda()?

Open miraclebiu opened this issue 6 years ago • 1 comments

  1. In trainer,the code is: inputs = [Variable(imgs)] outputs = self.model(*inputs) but the simple way is : inputs = Variable(imgs) outputs = self.model(inputs)
  2. why not .cuda() of the imgs so that Variable(imgs.cuda())

miraclebiu avatar Mar 21 '18 01:03 miraclebiu

For my understanding, through a GPU net (model = model.cuda()), the variable imgs on CPU with convert to GPU as well. There is no need to do imgs.cuda()

cuhk-hbsun avatar Apr 02 '18 06:04 cuhk-hbsun