Skip to content
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

python testcuda.py error #28

Open
xtanitfy opened this issue May 8, 2021 · 3 comments
Open

python testcuda.py error #28

xtanitfy opened this issue May 8, 2021 · 3 comments

Comments

@xtanitfy
Copy link

xtanitfy commented May 8, 2021

(Pytorch-1.4.0) sh-4.3$python testcuda.py
torch.Size([2, 64, 128, 128])
torch.Size([20, 32, 7, 7])
torch.Size([20, 32, 7, 7])
torch.Size([20, 32, 7, 7])
0.971507, 1.943014
0.971507, 1.943014
Zero offset passed
/home/ma-user/anaconda3/envs/Pytorch-1.4.0/lib/python3.6/site-packages/torch/autograd/gradcheck.py:302: UserWarning: The {}th input requires gradient and is not a double precision floating point or complex. This check will likely fail if all the inputs are not of double precision floating point or complex.
'The {}th input requires gradient and '
check_gradient_dpooling: True
Traceback (most recent call last):
File "testcuda.py", line 265, in
check_gradient_dconv()
File "testcuda.py", line 97, in check_gradient_dconv
eps=1e-3, atol=1e-4, rtol=1e-2))
File "/home/ma-user/anaconda3/envs/Pytorch-1.4.0/lib/python3.6/site-packages/torch/autograd/gradcheck.py", line 390, in gradcheck
checkIfNumericalAnalyticAreClose(a, n, j)
File "/home/ma-user/anaconda3/envs/Pytorch-1.4.0/lib/python3.6/site-packages/torch/autograd/gradcheck.py", line 372, in checkIfNumericalAnalyticAreClose
'numerical:%s\nanalytical:%s\n' % (i, j, n, a))
File "/home/ma-user/anaconda3/envs/Pytorch-1.4.0/lib/python3.6/site-packages/torch/autograd/gradcheck.py", line 289, in fail_test
raise RuntimeError(msg)
RuntimeError: Jacobian mismatch for output 0 with respect to input 1,
numerical:tensor([[ 0.0000, 0.0000, 0.0000, ..., 0.0000, 0.0000, 0.0000],
[ 0.0000, 0.0041, 0.0000, ..., 0.0000, 0.0000, 0.0000],
[ 0.0000, 0.0000, 0.0000, ..., 0.0000, 0.0000, 0.0000],
...,
[ 0.0000, 0.0000, 0.0000, ..., -0.0018, 0.0000, 0.0000],
[ 0.0000, 0.0000, 0.0000, ..., 0.0000, 0.0000, 0.0000],
[ 0.0000, 0.0000, 0.0000, ..., 0.0000, 0.0000, 0.0009]],
device='cuda:0')
analytical:tensor([[ 0.0000, 0.0000, 0.0000, ..., 0.0000, 0.0000, 0.0000],
[ 0.0000, 0.0041, 0.0000, ..., 0.0000, 0.0000, 0.0000],
[ 0.0000, 0.0000, 0.0000, ..., 0.0000, 0.0000, 0.0000],
...,
[ 0.0000, 0.0000, 0.0000, ..., -0.0018, 0.0000, 0.0000],
[ 0.0000, 0.0000, 0.0000, ..., 0.0000, 0.0000, 0.0000],
[ 0.0000, 0.0000, 0.0000, ..., 0.0000, 0.0000, 0.0009]],
device='cuda:0')

@xtanitfy
Copy link
Author

xtanitfy commented May 8, 2021

chage the line 97 as follow and the error dispear:

print('check_gradient_dconv: ',
gradcheck(dcn_v2_conv, (input, offset, mask, weight, bias,
stride, padding, dilation, deformable_groups),
eps=1e-3, atol=1e-3, rtol=1e-2))

@lucasjinreal
Copy link
Owner

I am not sure this version compatible with pytorcch 1.4, it is tested on latest version of pytorch

@peizhaoli05
Copy link

I am having the same error while using PyTorch 1.8.1/1.7.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants