Lavender105 / DFF

Code for Dynamic Feature Fusion for Semantic Edge Detection https://arxiv.org/abs/1902.09104
MIT License
220 stars 51 forks source link

In train.py, DataParallelModel(self.model) is not cuda() enabled. #31

Open bang2003er opened 1 year ago

bang2003er commented 1 year ago

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?