sthanhng / yoloface

Deep learning-based Face detection using the YOLOv3 algorithm (https://github.com/sthanhng/yoloface)
MIT License
452 stars 180 forks source link

Failed to run, IndexError: invalid index to scalar variable. #40

Open karim-hussein-ai opened 2 years ago

karim-hussein-ai commented 2 years ago

Hi, when I run python3 yoloface.py --src 0 --output-dir outputs/ The output be like:

----- info -----
[i] The config file:  ./cfg/yolov3-face.cfg
[i] The weights of model file:  ./model-weights/yolov3-wider_16000.weights
[i] Path to image file:  
[i] Path to video file:  
###########################################################

==> Skipping create the outputs/ directory...
[ERROR:0@0.355] global /io/opencv/modules/videoio/src/cap.cpp (595) open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.5.5) /io/opencv/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): outputs/ in function 'icvExtractPattern'

Traceback (most recent call last):
  File "yoloface.py", line 155, in <module>
    _main()
  File "yoloface.py", line 117, in _main
    outs = net.forward(get_outputs_names(net))
  File "/home/karim/Micropolis/New Hardware/yoloface/utils.py", line 48, in get_outputs_names
    return [layers_names[i[0] - 1] for i in net.getUnconnectedOutLayers()]
  File "/home/karim/Micropolis/New Hardware/yoloface/utils.py", line 48, in <listcomp>
    return [layers_names[i[0] - 1] for i in net.getUnconnectedOutLayers()]
IndexError: invalid index to scalar variable.
AndreKev commented 2 years ago

Could you solve the issue ?

AndreKev commented 2 years ago

To fix this, replace the utils.py file by this one

utils.txt

rename it "utils.py"

Trevo1 commented 2 years ago

To fix this, replace the utils.py file by this one

utils.txt

rename it "utils.py"

thanks~

AndreKev commented 2 years ago

I think we can close this issue