FaceDetection-DSFD icon indicating copy to clipboard operation
FaceDetection-DSFD copied to clipboard

The following error was reported during my running demo.py: RuntimeError: Legacy autograd function with non-static forward method is deprecated,

Open smallsun1122 opened this issue 5 years ago • 8 comments

smallsun1122 avatar Sep 25 '20 13:09 smallsun1122

I had the same problem, probably because the version of the Torch was too high, but I couldn't fix it.I wonder if you have solved this problem?

q838458640 avatar Apr 19 '21 12:04 q838458640

同学,你好,时间太久了,我有点忘记了,我在网上找了一些解决办法,看能不能帮到你,这些解决办法我看着有点熟悉 ,可能是之前用过的,希望可以帮到你。

------------------ 原始邮件 ------------------ 发件人: "Tencent/FaceDetection-DSFD" @.>; 发送时间: 2021年4月19日(星期一) 晚上8:27 @.>; 抄送: "small @.@.>; 主题: Re: [Tencent/FaceDetection-DSFD] The following error was reported during my running demo.py: RuntimeError: Legacy autograd function with non-static forward method is deprecated, (#72)

I had the same problem, probably because the version of the Torch was too high, but I couldn't fix it.I wonder if you have solved this problem?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

smallsun1122 avatar Apr 19 '21 14:04 smallsun1122

感谢您

q838458640 avatar Apr 19 '21 15:04 q838458640

I also had the same issue, can I ask how do you fix the problems? I will really appreciate it!

WeiCUI6 avatar May 18 '21 17:05 WeiCUI6

Any answer??

berkanttubi avatar Sep 19 '21 20:09 berkanttubi

add @staticmethod to the beginning of the function that error has been occured.

berkanttubi avatar Sep 19 '21 21:09 berkanttubi

I had the same problem, probably because the version of the Torch was too high, but I couldn't fix it.I wonder if you have solved this problem? 我也遇到了同样的问题,请问解决了吗?

funykatebird avatar May 12 '22 08:05 funykatebird

you can easily solve this problem by: do changes in face_ssd.py:

output = self.detect(
                  face_loc.view(face_loc.size(0), -1, 4),         # loc preds
                  self.softmax(face_conf.view(face_conf.size(0), -1, self.num_classes)), # conf preds
                  self.priors.type(type(x.data))                  # default boxes
                )

to the below code:

output = self.detect.forward(
                  face_loc.view(face_loc.size(0), -1, 4),         # loc preds
                  self.softmax(face_conf.view(face_conf.size(0), -1, self.num_classes)), # conf preds
                  self.priors.type(type(x.data))                  # default boxes
                )

wengshihao avatar Aug 17 '22 19:08 wengshihao