swoook / dsfd Goto Github PK
View Code? Open in Web Editor NEWCloned from Tencent/FaceDetection-DSFD (https://github.com/Tencent/FaceDetection-DSFD)
License: Other
Cloned from Tencent/FaceDetection-DSFD (https://github.com/Tencent/FaceDetection-DSFD)
License: Other
ImportError: cannot import name 'pa_sfd_match'
root@68e19c8a175f:/swook/repos/tencent/dsfd# python demo.py --trained_model /swook/model/dsfd/WIDERFace_DSFD_RES152.pth \
> --img_root /swook/dataset/wider-face-WIDER_val \
> --save_folder ./save \
> --visual_threshold 0.1
ImportError: cannot import name 'pa_sfd_match'
Traceback (most recent call last):
File "demo.py", line 27, in <module>
from face_ssd import build_ssd
File "/swook/repos/tencent/dsfd/face_ssd.py", line 13, in <module>
from layers import *
File "/swook/repos/tencent/dsfd/layers/__init__.py", line 2, in <module>
from .modules import *
File "/swook/repos/tencent/dsfd/layers/modules/__init__.py", line 2, in <module>
from .multibox_loss import MultiBoxLoss, focalLoss
File "/swook/repos/tencent/dsfd/layers/modules/multibox_loss.py", line 13, in <module>
from ..box_utils import (log_sum_exp, match, pa_sfd_match, refine_match,
ImportError: cannot import name 'pa_sfd_match'
wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
RuntimeError: CUDA out of memory. Tried to allocate 62.00 MiB (GPU 0; 10.76 GiB total capacity; 9.65 GiB already allocated; 45.94 MiB free; 9.91 GiB reserved in total by PyTorch)
python demo.py --trained_model /swook/model/dsfd/WIDERFace_DSFD_RES152.pth --widerface_root /swook/dataset/wider-face/WIDER_val --save_folder ./save --visual_threshold 0.1 --cuda CUDA
RuntimeError: CUDA out of memory. Tried to allocate 62.00 MiB (GPU 0; 10.76 GiB total capacity; 9.65 GiB already allocated; 45.94 MiB free; 9.91 GiB reserved in total by PyTorch)
Traceback (most recent call last):
File "demo.py", line 222, in <module>
test_oneimage()
File "demo.py", line 201, in test_oneimage
det_b = infer(net , img , transform , thresh , cuda , bt)
File "demo.py", line 72, in infer
y = net(x) # forward pass
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
result = self.forward(*input, **kwargs)
File "/swook/repos/tencent/dsfd/face_ssd.py", line 240, in forward
conv5_3_x = self.layer3(conv4_3_x)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
result = self.forward(*input, **kwargs)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/container.py", line 92, in forward
input = module(input)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
result = self.forward(*input, **kwargs)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/container.py", line 92, in forward
input = module(input)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
result = self.forward(*input, **kwargs)
File "/opt/conda/lib/python3.6/site-packages/torchvision/models/resnet.py", line 109, in forward
out = self.bn3(out)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
result = self.forward(*input, **kwargs)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/batchnorm.py", line 79, in forward
exponential_average_factor, self.eps)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/functional.py", line 1670, in batch_norm
training, momentum, eps, torch.backends.cudnn.enabled
RuntimeError: CUDA out of memory. Tried to allocate 62.00 MiB (GPU 0; 10.76 GiB total capacity; 9.65 GiB already allocated; 45.94 MiB free; 9.91 GiB reserved in total by PyTorch)
/opt/conda/lib/python3.6/site-packages/torch/cuda/__init__.py:95: UserWarning:
Found GPU0 GeForce RTX 2080 Ti which requires CUDA_VERSION >= 9000 for
optimal performance and fast startup time, but your PyTorch was compiled
with CUDA_VERSION 8000. Please install the correct PyTorch binary
using instructions from http://pytorch.org
warnings.warn(incorrect_binary_warn % (d, name, 9000, CUDA_VERSION))
Downgrade PyTorch in nvcr.io/nvidia/pytorch:19.11-py3
root@501243bba88b:/swook# pip install torch==0.3.1 torchvision==0.2.1
pytorch-transformers 1.1.0 has requirement torch>=1.0.0, but you'll have torch 0.3.1 which is incompatible.
Inspect containers
(py36torch14) swook@durian:/data/swook/download$ docker ps
Commit a container for nvcr.io/nvidia/pytorch:19.11-py3
(py36torch14) swook@durian:/data/swook/download$ docker commit fc5d3760e589 swook/torch031:19.11-py3
Run a demo in a swook/torch031:19.11-py3
root@501243bba88b:/swook/repos/tencent/dsfd# python demo.py --trained_model /swook/model/dsfd/WIDERFace_DSFD_RES152.pth --widerface_root /swook/dataset/wider-face/WIDER_val/ --save_folder ./save --visual_threshold 0.1 --cuda CUDA
/opt/conda/lib/python3.6/site-packages/torch/cuda/__init__.py:95: UserWarning:
Found GPU0 GeForce RTX 2080 Ti which requires CUDA_VERSION >= 9000 for
optimal performance and fast startup time, but your PyTorch was compiled
with CUDA_VERSION 8000. Please install the correct PyTorch binary
using instructions from http://pytorch.org
warnings.warn(incorrect_binary_warn % (d, name, 9000, CUDA_VERSION))
torch==0.3.1
or belowtorch
torch
i usetorch==1.4.0a
torch==0.3.1
torch==0.3.1
ValueError: not enough values to unpack (expected 2, got 0)
python widerface_val_torch140.py --trained_model /swook/model/dsfd/WIDERFace_DSFD_RES152.pth --widerface_root /swook/dataset/wider-face --save_folder ./val-res/wider-face-val --cuda CUDA
ValueError: not enough values to unpack (expected 2, got 0)
Traceback (most recent call last):
File "widerface_val_torch140.py", line 311, in <module>
test_widerface()
File "widerface_val_torch140.py", line 296, in test_widerface
det0 = detect_face(image, shrink) # origin test
File "widerface_val_torch140.py", line 66, in detect_face
y = net(x)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
result = self.forward(*input, **kwargs)
File "/swook/repos/tencent/dsfd/face_ssd.py", line 348, in forward
self.priors.type(type(x.data)) # default boxes
File "/swook/repos/tencent/dsfd/layers/functions/detection.py", line 75, in forward
ids, count = nms(boxes, scores, self.nms_thresh, self.top_k)
ValueError: not enough values to unpack (expected 2, got 0)
RuntimeError: CUDNN_STATUS_EXECUTION_FAILED
Remove torch
and torchvision
in nvcr.io/nvidia/pytorch:19.11-py3
root@501243bba88b:/swook# pip uninstall torch torchvision
Install torch==0.3.1
complied with CUDA_VERSION = 9000
root@501243bba88b:/swook# conda install https://anaconda.org/pytorch/pytorch/0.3.1/download/linux-64/pytorch-0.3.1-py36_cuda9.1.85_cudnn7.0.5_2.tar.bz2
torch==0.3.1
for other CUDA from hereInstall torchvision==0.2.1
root@501243bba88b:/swook# pip install torchvision==0.2.1
Inspect containers
(py36torch14) swook@durian:/data/swook/download$ docker ps
Commit a container for nvcr.io/nvidia/pytorch:19.11-py3
(py36torch14) swook@durian:/data/swook/download$ docker commit fc5d3760e589 swook/torch031:19.11-py3
Run a demo in a swook/torch031:19.11-py3
root@501243bba88b:/swook/repos/tencent/dsfd# python demo.py --trained_model /swook/model/dsfd/WIDERFace_DSFD_RES152.pth --widerface_root /swook/dataset/wider-face/WIDER_val/ --save_folder ./save --visual_threshold 0.1 --cuda CUDA
RuntimeError: CUDNN_STATUS_EXECUTION_FAILED
Traceback (most recent call last):
File "demo.py", line 207, in <module>
test_oneimage()
File "demo.py", line 172, in test_oneimage
det0 = infer(net , img , transform , thresh , cuda , shrink)
File "demo.py", line 72, in infer
y = net(x) # forward pass
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
result = self.forward(*input, **kwargs)
File "/swook/repos/tencent/dsfd/face_ssd.py", line 238, in forward
conv3_3_x = self.layer1(x)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
result = self.forward(*input, **kwargs)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/container.py", line 67, in forward
input = module(input)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
result = self.forward(*input, **kwargs)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 282, in forward
self.padding, self.dilation, self.groups)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/functional.py", line 90, in conv2d
return f(input, weight, bias)
If you have a question or would like help and support, please ask at our
forums.
If you are submitting a feature request, please preface the title with [feature request].
If you are submitting a bug report, please fill in the following details.
The output error:
RuntimeError: Legacy autograd function with non-static forward method is deprecated. Please use new-style autograd function with static forward method. (Example: https://pytorch.org/docs/stable/autograd.html#torch.autograd.Function)
The error started in :
Script: demo.py
Function: def infer(net , img , transform , thresh , cuda , shrink):
Line: y = net(x) # forward pass
The end point was the script: face_ssd.py
Function : def forward(self, x):
Provide a short description.
Looks like to be a compatibility with pytorch version
was only to run the script: demo.py
Please try to provide a minimal example to repro the bug.
Error messages and stack traces are also helpful.
Collecting environment information...
PyTorch version: 1.9.1+cu111
Is debug build: False
CUDA used to build PyTorch: 11.1
ROCM used to build PyTorch: N/A
OS: Ubuntu 20.04.4 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.31
Python version: 3.9.12 (main, Apr 5 2022, 06:56:58) [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.13.0-52-generic-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: 10.1.243
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3060
Nvidia driver version: 510.73.05
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.21.5
[pip3] numpydoc==1.2
[pip3] torch==1.11.0
[pip3] torchaudio==0.9.1
[pip3] torchvision==0.12.0
[conda] blas 1.0 mkl
[conda] cudatoolkit 10.2.89 hfd86e86_1
[conda] ffmpeg 4.3 hf484d3e_0 pytorch
[conda] mkl 2021.4.0 h06a4308_640
[conda] mkl-service 2.4.0 py39h7f8727e_0
[conda] mkl_fft 1.3.1 py39hd3c417c_0
[conda] mkl_random 1.2.2 py39h51133e4_0
[conda] numpy 1.21.5 py39he7a7128_1
[conda] numpy-base 1.21.5 py39hf524024_1
[conda] numpydoc 1.2 pyhd3eb1b0_0
[conda] pytorch-mutex 1.0 cuda pytorch
[conda] torch 1.11.0 pypi_0 pypi
[conda] torchaudio 0.9.1 pypi_0 pypi
[conda] torchvision 0.10.1+cu111 pypi_0 pypi
Please copy and paste the output from our
environment collection script
(or fill out the checklist below manually).
You can get the script and run it with:
wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
FileNotFoundError: [Errno 2] No such file or directory: '/swook/dataset/wider-face/WIDER_val/wider_face_split/wider_face_val.mat'
root@80d507e4db93:/swook/repos/tencent/dsfd# python demo.py --trained_model /swook/model/dsfd/WIDERFace_DSFD_RES152.pth --widerface_root /swook/dataset/wider-face/WIDER_val --save_folder ./save --visual_threshold 0.1 --cuda CUDA
FileNotFoundError: [Errno 2] No such file or directory: '/swook/dataset/wider-face/WIDER_val/wider_face_split/wider_face_val.mat'
Traceback (most recent call last):
File "demo.py", line 28, in <module>
from widerface_val import bbox_vote
File "/swook/repos/tencent/dsfd/widerface_val.py", line 236, in <module>
testset = WIDERFaceDetection(args.widerface_root, 'val' , None, WIDERFaceAnnotationTransform())
File "/swook/repos/tencent/dsfd/data/widerface.py", line 150, in __init__
self.f = scipy.io.loadmat(osp.join(self.path_to_label, self.fname))
File "/opt/conda/lib/python3.6/site-packages/scipy/io/matlab/mio.py", line 216, in loadmat
with _open_file_context(file_name, appendmat) as f:
File "/opt/conda/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/opt/conda/lib/python3.6/site-packages/scipy/io/matlab/mio.py", line 19, in _open_file_context
f, opened = _open_file(file_like, appendmat, mode)
File "/opt/conda/lib/python3.6/site-packages/scipy/io/matlab/mio.py", line 45, in _open_file
return open(file_like, mode), True
FileNotFoundError: [Errno 2] No such file or directory: '/swook/dataset/wider-face/WIDER_val/wider_face_split/wider_face_val.mat'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.