-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use new-style autograd function with static forward method. #63
Comments
Hi Kevin, how did you resolve this error? I have exactly the same problem. |
Me too |
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 # 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)))
###########################################################修改代码################################################################ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
test_oneimage()
File "demo.py", line 245, in test_oneimage
det = bbox_vote(det)
File "demo.py", line 69, in bbox_vote
det_accu_sum[:, 0:4] = np.sum(det_accu[:, 0:4], axis=0) / np.sum(det_accu[:, -1:])
File "/home/kzezel/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/tensor.py", line 398, in rdiv
return self.reciprocal() * other
File "/home/kzezel/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/tensor.py", line 486, in array
return self.numpy()
TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
The text was updated successfully, but these errors were encountered: