运行predict.py时报错
RuntimeError: Legacy autograd function with non-static forward method is deprecated. Please use new-style autograd function with static forward method.
解决了?
版本
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)), # conf preds self.priors
呀哈
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)), # conf preds self.priors
感谢老哥,解决了我的问题!
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)), # conf preds self.priors
谢谢老哥!