ssd-pytorch
ssd-pytorch copied to clipboard
RuntimeError: Legacy autograd function with non-static forward method is deprecated.
环境问题
torch>=1.3
predict.py会报错
RuntimeError: Legacy autograd function with non-static forward method is deprecated.
在pytorch1.3及以后的版本需要规定forward方法为静态方法,对此修改以下片段就能work before
if self.phase == "test":
output = self.detect.forward(
loc.view(loc.size(0), -1, 4),
self.softmax(conf.view(conf.size(0), -1, self.num_classes)),
self.priors
)
after
if self.phase == "test":
output = self.detect.forward(
loc.view(loc.size(0), -1, 4),
self.softmax(conf.view(conf.size(0), -1, self.num_classes)),
self.priors
)
更新后还有吗……,我已经改了这段了
更新后还有吗……,我已经改了这段了
母鸡啊,我没用过更新的。看doc自己改完解决了
好的解决了就好,可以看看新库
好的解决了就好,可以看看新库
感谢你的implement