Tencent / FaceDetection-DSFD

腾讯优图高精度双分支人脸检测器

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

smallsun1122 opened this issue · comments

commented

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?

commented

感谢您

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

Any answer??

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

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 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
                )