Legacy autograd function with non-static forward method is deprecated
生活随笔
收集整理的這篇文章主要介紹了
Legacy autograd function with non-static forward method is deprecated
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Legacy autograd function with non-static forward method is deprecated
在網絡s3fd_atss_sapd 測試時發現這個問題,
detect 是個Function,
class Detect(Function):xxxself.detect = Detect(cfg)改之前代碼:
if self.phase == 'test':output = self.detect(loc.view(loc.size(0), -1, 4), # loc predsself.softmax.forward(conf.view(conf.size(0), -1,self.num_classes)), # conf preds# self.priors.type(type(x.data)) # default boxesself.priors.type_as(x) # default boxes)改之后代碼:
if self.phase == 'test':output = self.detect.forward(loc.view(loc.size(0), -1, 4), # loc predsself.softmax.forward(conf.view(conf.size(0), -1,self.num_classes)), # conf preds# self.priors.type(type(x.data)) # default boxesself.priors.type_as(x) # default boxes)基本上與網上方法一致,
網上的方法:
Legacy autograd function with non-static forward method is deprecated. - 知乎
解決方案是將ssd.py中的以下代碼進行修改:
修改為
發布于 2021-03-09 22:
總結
以上是生活随笔為你收集整理的Legacy autograd function with non-static forward method is deprecated的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: system.exe,alien32.e
- 下一篇: “毕业季”|一个java开发实习生的OF