DFF
DFF copied to clipboard
In train.py, DataParallelModel(self.model) is not cuda() enabled.
I am trying to run train.py, but it gets stuck when running the following code.:
if args.cuda:
self.model = DataParallelModel(self.model).cuda()
self.criterion = DataParallelCriterion(self.criterion).cuda()
I checked the location of DataParallelModel and found that there is no cuda() method in it. On the contrary, when I modified the following code snippet, the program ran successfully:
if args.cuda:
#self.model = DataParallelModel(self.model).cuda()
self.model = DataParallelModel(self.model)
#self.criterion = DataParallelCriterion(self.criterion).cuda()
self.criterion = DataParallelCriterion(self.criterion)
Why?