FaceDetection-DSFD
FaceDetection-DSFD copied to clipboard
Use new-style autograd function with static forward method.
HI, I got this error:
pytorch==1.4.0 torchvision==0.2.1
loading pretrained resnet model
Finished loading model!
demo.py:94: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad():
instead.
x = Variable(x.unsqueeze(0) , volatile=True)
/home/kzezel/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/nn/functional.py:2416: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.
warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.")
/home/kzezel/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/nn/functional.py:2506: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
"See the documentation of nn.Upsample for details.".format(mode))
/home/kzezel/Kevin Zezel Gomes/FaceDetection-DSFD/face_ssd.py:187: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad():
instead.
prior = Variable( priorbox.forward() , volatile=True)
/tmp/pip-req-build-808afw3c/torch/csrc/autograd/python_function.cpp:622: UserWarning: Legacy autograd function with non-static forward method is deprecated and will be removed in 1.3. Please use new-style autograd function with static forward method. (Example: https://pytorch.org/docs/stable/autograd.html#torch.autograd.Function)
/tmp/pip-req-build-808afw3c/torch/csrc/autograd/python_function.cpp:622: UserWarning: Legacy autograd function with non-static forward method is deprecated and will be removed in 1.3. Please use new-style autograd function with static forward method. (Example: https://pytorch.org/docs/stable/autograd.html#torch.autograd.Function)
/tmp/pip-req-build-808afw3c/torch/csrc/autograd/python_function.cpp:622: UserWarning: Legacy autograd function with non-static forward method is deprecated and will be removed in 1.3. Please use new-style autograd function with static forward method. (Example: https://pytorch.org/docs/stable/autograd.html#torch.autograd.Function)
/tmp/pip-req-build-808afw3c/torch/csrc/autograd/python_function.cpp:622: UserWarning: Legacy autograd function with non-static forward method is deprecated and will be removed in 1.3. Please use new-style autograd function with static forward method. (Example: https://pytorch.org/docs/stable/autograd.html#torch.autograd.Function)
Traceback (most recent call last):
File "demo.py", line 250, in
Hi Kevin, how did you resolve this error? I have exactly the same problem.
Hi Kevin, how did you resolve this error? I have exactly the same problem.
Me too
Hi Kevin, how did you resolve this error? I have exactly the same problem.
me too... :(
Not yet
------------------ 原始邮件 ------------------ 发件人: "Tencent/FaceDetection-DSFD" @.>; 发送时间: 2021年7月22日(星期四) 下午2:34 @.>; @.@.>; 主题: Re: [Tencent/FaceDetection-DSFD] Use new-style autograd function with static forward method. (#63)
Hi Kevin, how did you resolve this error? I have exactly the same problem.
me too... :(
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
I am facing the same proble, has anyone figured it out ?
@gkrisp98 change face_ssd.py line 345 to:
# 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
# )
###########################################################修改代码################################################################
# Detect类不支持静态方法的前向传播,因此使用类直接调用方法
output = self.detect.forward(face_loc.view(face_loc.size(0), -1, 4),
self.softmax(face_conf.view(face_conf.size(0), -1, self.num_classes)),
self.priors.type(type(x.data)))
###########################################################修改代码################################################################