Git Product home page Git Product logo

dsfd's People

Contributors

chaunceywang avatar chengjie-cjwang avatar lijiannuist avatar swoook avatar tyshiwo avatar z-bingo avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

kudonct

dsfd's Issues

ImportError: cannot import name 'pa_sfd_match' when executing demo.py

Issue description

  • demo.py fails to run with the error below
ImportError: cannot import name 'pa_sfd_match'

Code example

  • Command to reproduce the bug:
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
  • Error messages:
ImportError: cannot import name 'pa_sfd_match'
  • Whole stack traces:
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'

System Info

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
  • PyTorch or Caffe2: PyTorch
  • How you installed PyTorch (conda, pip, source): docker (nvcr.io/nvidia/pytorch)
  • Build command you used (if compiling from source): None
  • OS: Ubuntu 16.04 LTS
  • PyTorch version: 1.4.0
  • Python version: 3.6
  • CUDA/cuDNN version: 10.2
  • GPU models and configuration: 2080 Ti
  • GCC version (if compiling from source): None
  • CMake version: None
  • Versions of any other relevant libraries: None

RuntimeError: CUDA out of memory occurred while running demo.py

Issue description

  • demo.py fails to run with the error below
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)

Code example

  • Command to reproduce the bug:
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
  • Error messages:
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)
  • Whole stack traces:
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)

System Info

  • PyTorch or Caffe2: PyTorch
  • How you installed PyTorch (conda, pip, source): docker (nvcr.io/nvidia/pytorch)
  • Build command you used (if compiling from source): None
  • OS: Ubuntu 16.04 LTS
  • PyTorch version: 1.4.0
  • Python version: 3.6
  • CUDA/cuDNN version: 10.2
  • GPU models and configuration: 2080 Ti
  • GCC version (if compiling from source): None
  • CMake version: None
  • Versions of any other relevant libraries: None

torch==0.3.1 i installed isn't optimal for the latest GPU devices

Issue description

  • Running python scripts for DSFD from this repo is too slow
    • Loading a model takes almost 520s
  • And i confirmed the warning below while running a demo:
/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))

Code example

  • Command to reproduce the bug:
  1. Downgrade PyTorch in nvcr.io/nvidia/pytorch:19.11-py3

    root@501243bba88b:/swook# pip install torch==0.3.1 torchvision==0.2.1
    
    • Confirmed the warnings below:
    pytorch-transformers 1.1.0 has requirement torch>=1.0.0, but you'll have torch 0.3.1 which is incompatible.
    
    • Confirmed it's irrelevant for Tencent/DSFD
  2. Inspect containers

    (py36torch14) swook@durian:/data/swook/download$ docker ps
    
  3. 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
    
  4. 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
    
  • Error messages: Not error, but confirmed a warning message
/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))
  • Whole stack traces: None

System Info

  • PyTorch or Caffe2: PyTorch
  • How you installed PyTorch (conda, pip, source): docker (nvcr.io/nvidia/pytorch)
  • Build command you used (if compiling from source): None
  • OS: Ubuntu 16.04 LTS
  • PyTorch version: 0.3.1
  • Python version: 3.6
  • CUDA/cuDNN version: 10.2
  • GPU models and configuration: 2080 Ti
  • GCC version (if compiling from source): None
  • CMake version: None
  • Versions of any other relevant libraries: None

widerface_val.py compatibility with `torch>=1.4.0`

  • Is your feature request related to a problem? Please describe.
  • It seems ${DSFD_DIR}/widerface_val.py is also only compatible with torch==0.3.1 or below
  • Refer to this commit for more details about incompatibiliy issue with torch
  • It'd be better to add validation script for the torch i use
  • Describe the solution you'd like
  • ${DSFD_DIR}/widerface_val.py supports the torch==1.4.0a
  • Describe alternatives you've considered
  • Using a docker for torch==0.3.1
  • However, PyTorch or NVIDIA doesn't provide a docker for torch==0.3.1
  • So, i should build it myself if i'd like to use it
  • Additional context
  • None

ValueError: not enough values to unpack (expected 2, got 0) when running nms

Issue description

  • widerface_val_torch140.py fails to run with the error below
ValueError: not enough values to unpack (expected 2, got 0)

Code example

  • Command to reproduce the bug:
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
  • Error messages:
ValueError: not enough values to unpack (expected 2, got 0)
  • Whole stack traces:
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)

System Info

  • PyTorch or Caffe2: PyTorch
  • How you installed PyTorch (conda, pip, source): docker (nvcr.io/nvidia/pytorch)
  • Build command you used (if compiling from source): None
  • OS: Ubuntu 16.04 LTS
  • PyTorch version: 1.4.0
  • Python version: 3.6
  • CUDA/cuDNN version: 10.2
  • GPU models and configuration: 2080 Ti
  • GCC version (if compiling from source): None
  • CMake version: None
  • Versions of any other relevant libraries: None

RuntimeError: CUDNN_STATUS_EXECUTION_FAILED

Issue description

  • demo.py fails to run with the error below
RuntimeError: CUDNN_STATUS_EXECUTION_FAILED

Code example

  • Command to reproduce the bug:
  1. Remove torch and torchvision in nvcr.io/nvidia/pytorch:19.11-py3

    root@501243bba88b:/swook# pip uninstall torch torchvision
    
  2. 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
    
    • We can find torch==0.3.1 for other CUDA from here
  3. Install torchvision==0.2.1

    root@501243bba88b:/swook# pip install torchvision==0.2.1
    
  4. Inspect containers

    (py36torch14) swook@durian:/data/swook/download$ docker ps
    
  5. 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
    
  6. 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
    
  • Error messages:
RuntimeError: CUDNN_STATUS_EXECUTION_FAILED
  • Whole stack traces:
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)

System Info

  • PyTorch or Caffe2: PyTorch
  • How you installed PyTorch (conda, pip, source): docker (nvcr.io/nvidia/pytorch)
  • Build command you used (if compiling from source): None
  • OS: Ubuntu 16.04 LTS
  • PyTorch version: 0.3.1.post2
  • Python version: 3.6
  • CUDA/cuDNN version: 10.2
  • GPU models and configuration: 2080 Ti
  • GCC version (if compiling from source): None
  • CMake version: None
  • Versions of any other relevant libraries: None

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)

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.

Issue description

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

Code example

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.

System Info

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
  • PyTorch or Caffe2:
  • How you installed PyTorch (conda, pip, source):
  • Build command you used (if compiling from source):
  • OS:
  • PyTorch version:
  • Python version:
  • CUDA/cuDNN version:
  • GPU models and configuration:
  • GCC version (if compiling from source):
  • CMake version:
  • Versions of any other relevant libraries:

FileNotFoundError: [Errno 2] No such file or directory: ${WIDER_VAL_DIR}/wider_face_split/wider_face_val.mat when executing demo.py on WIDER FACE val

Issue description

  • demo.py fails to run with the error below
FileNotFoundError: [Errno 2] No such file or directory: '/swook/dataset/wider-face/WIDER_val/wider_face_split/wider_face_val.mat'

Code example

  • Command to reproduce the bug:
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
  • Error messages:
FileNotFoundError: [Errno 2] No such file or directory: '/swook/dataset/wider-face/WIDER_val/wider_face_split/wider_face_val.mat'
  • Whole stack traces:
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'

Request the benchmarks on 2080 Ti RTX

  • Is your feature request related to a problem? Please describe.
  • Need to know a latency in detail to determine use DSFD
  • Describe the solution you'd like
  • Measure the latency
  • Describe alternatives you've considered
  • Find out the paper suggests any information about its latency
  • Additional context
  • None

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.