dpk3
dpk3
关于指定GPU:若想使用gpu1和gpu2,程序开头多加一条语句 os.environ【"CUDA_VISIBLE_DEVICES"】 = "1,2",作用是只允许gpu1和gpu2可用,然后使用Model = nn.DataParallel(Model, device_ids=【0,1】),作用是从可用的两个gpu中搜索第0和第1个位置的gpu。 经测试 可行
66ssd-pytorch/nets/ssd.py 下66行左右 if self.phase == "test": # loc会resize到batch_size,num_anchors,4 # conf会resize到batch_size,num_anchors, # output = self.detect( output = self.detect.**forward**( #出错修改 很简单 detect后加forward loc.view(loc.size(0), -1, 4), # loc preds self.softmax(conf.view(conf.size(0), -1, self.num_classes)), #...