Cysu / open-reid

Open source person re-identification library in python
https://cysu.github.io/open-reid/
MIT License
1.33k stars 349 forks source link

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

Open miraclebiu opened 6 years ago

miraclebiu commented 6 years ago

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())

cuhk-hbsun commented 6 years ago

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()