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

mask_fp_context_ft[tmp_shift] = 1,IndexError: index 5 is out of bounds for dimension 2 with size 5 #3

Open
JayL323 opened this issue Dec 7, 2022 · 0 comments

Comments

@JayL323
Copy link

JayL323 commented Dec 7, 2022

Thank you for sharing this project. I always encounter similar mistakes, can you help me to see the reason?

【cpu environment,python 3.6.7,torch 1.10.2】
Load model from ./model_70000.pth
Finish load model.
img-id1-object-1.png
width: 327, height: 314
C:/Users//Downloads/MogFace-master/aa.py:53: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
x = Variable(x, volatile=True)
C:\my_dir*\venv\lib\site-packages\torch\nn\functional.py:3509: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.
warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.")
C:\my_dir*\venv\lib\site-packages\torch\nn\functional.py:3635: 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)
C:\my_dir*\venv\lib\site-packages\torch\nn\functional.py:1806: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.
warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.")
pyramid_feature_list: 6
Traceback (most recent call last):
File "C:/Users/
/Downloads/MogFace-master/aa.py", line 237, in
boxes = process_img(img, net, generate_anchors_fn, normalize_setting)
File "C:/Users/
/Downloads/MogFace-master/aa.py", line 152, in process_img
boxes = detect_face(net, img, shrink, generate_anchors_fn) # origin test
File "C:/Users/
/Downloads/MogFace-master/aa.py", line 55, in detect_face
out = net(x)
File "C:\my_dir*\venv\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users*\Downloads\MogFace-master\modelling\architectures\widerface_basenet.py", line 83, in forward
conf, loc, mask_fp_context_fts = self.pred_net(pyramid_feature_list)
File "C:\my_dir*\venv\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users*\Downloads\MogFace-master\modelling\pred_modules\pred_net.py", line 267, in forward
mask_fp_context_ft[tmp_shift] = 1
IndexError: index 5 is out of bounds for dimension 2 with size 5
Process finished with exit code 1

【gpu environment,python 3.7.13,torch 1.10.0+cu111】
Load model from ./model_70000.pth
Finish load model.
face_wujian.jpg
width: 500, height: 500
/root/code//MogFace-master/aa.py:54: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
x = Variable(x.cuda(), volatile=True)
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py:3509: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.
warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.")
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py:3635: 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)
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py:1806: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.
warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.")
Inference time : 865
The image with bbox is saved as ./tmp_img/0.13437671850930222.jpg
face_age.png
width: 1160, height: 304
Inference time : 655
The image with bbox is saved as ./tmp_img/0.6703785369022076.jpg
img_00106.png
width: 540, height: 640
Inference time : 487
The image with bbox is saved as ./tmp_img/0.9521100804886025.jpg
single_face.jpeg
width: 700, height: 720
/pytorch/aten/src/ATen/native/cuda/IndexKernel.cu:93: operator(): block: [0,0,0], thread: [6,0,0] Assertion index >= -sizes[i] && index < sizes[i] && "index out of bounds" failed.
/pytorch/aten/src/ATen/native/cuda/IndexKernel.cu:93: operator(): block: [0,0,0], thread: [10,0,0] Assertion index >= -sizes[i] && index < sizes[i] && "index out of bounds" failed.
Traceback (most recent call last):
File "/root/code/
/MogFace-master/aa.py", line 234, in
boxes = process_img(img, net, generate_anchors_fn, normalize_setting)
File "/root/code//MogFace-master/aa.py", line 153, in process_img
boxes = detect_face(net, img, shrink, generate_anchors_fn) # origin test
File "/root/code/
/MogFace-master/aa.py", line 56, in detect_face
out = net(x)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(input, **kwargs)
File "/root/code/
/MogFace-master/modelling/architectures/widerface_basenet.py", line 75, in forward
conf, loc, mask_fp_context_fts = self.pred_net(pyramid_feature_list)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(input, **kwargs)
File "/root/code/
/MogFace-master/modelling/pred_modules/pred_net.py", line 266, in forward
mask_fp_context_ft[tmp_shift] = 1
RuntimeError: CUDA error: device-side assert triggered
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Process finished with exit code 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

1 participant