TNTWEN / OpenVINO-YOLOV4

This is implementation of YOLOv4,YOLOv4-relu,YOLOv4-tiny,YOLOv4-tiny-3l,Scaled-YOLOv4 and INT8 Quantization in OpenVINO2021.3
MIT License
239 stars 66 forks source link

Error with yolov4-tiny inference #14

Closed 4444borja closed 3 years ago

4444borja commented 4 years ago

Hi! I have tried converting yolov4.weights (full model) and running an inference, everything works fine. However, when I do the same thing but with yolov4-tiny.weights (tiny version) everything is okay until object_detection_demo_yolov3_async.py starts the inference. Then this error occurs:

[ INFO ] Creating Inference Engine...
[ INFO ] Loading network
[ INFO ] Preparing inputs
[ WARN:0] global ../opencv/modules/videoio/src/cap_gstreamer.cpp (898) open OpenCV | GStreamer warning: unable to query duration of stream
[ WARN:0] global ../opencv/modules/videoio/src/cap_gstreamer.cpp (935) open OpenCV | GStreamer warning: Cannot query video position: status=1, value=0, duration=-1
[ INFO ] Loading model to the plugin
[ INFO ] Starting inference...

Traceback (most recent call last):
  File "object_detection_demo_yolov3_async.py", line 518, in <module>
    sys.exit(main() or 0)
  File "object_detection_demo_yolov3_async.py", line 398, in main
    args.keep_aspect_ratio)
  File "object_detection_demo_yolov3_async.py", line 233, in get_objects
    out_blob = out_blob.buffer.reshape(net.layers[net.layers[layer_name].parents[0]].out_data[0].shape)
KeyError: 'detector/yolo-v4-tiny/strided_slice/Split.0'

Does somebody know why it works for the full version but not for the tiny version? Any help is very much appreciated.

TNTWEN commented 4 years ago

Hello!@4444borja I think your OpenVINO version is lower than 2020R4

4444borja commented 4 years ago

@TNTWEN Thank you for your quick response! I checked my version, i have installed openvino_2020.4.287 which should be enough. I ran the setupvars.sh script of that version so it should be using 2020R4.

Any idea if this could be because of something else?

TNTWEN commented 4 years ago

@4444borja You have installed two versions of OpenVINO on your PC? Do you make sure everything is right? I have met this error before,but it was solved when i installed openvino_2020.4.287. i have verfied that you also could convert this model successfully before openvino_2020.4.287,but the inference engine didn't support strided_slice/Split ,so "KeyError: 'detector/yolo-v4-tiny/strided_slice/Split.0'" will happen And this repos ‘s yolov4-tiny have been tested on python and C++ demo

4444borja commented 4 years ago

@TNTWEN Okay, it must be a problem with my installation then. I will check!

4444borja commented 4 years ago

Hi @TNTWEN , I checked several times in different machines, and the problem still exists, but only on the yolov4-tiny model.

The yolov4 full model works good, and I am able to run the demo with the camera on real time, but when I try the same thing with the tiny model, it gives the error below

Traceback (most recent call last): File "object_detection_demo_yolov3_async.py", line 518, in sys.exit(main() or 0) File "object_detection_demo_yolov3_async.py", line 398, in main args.keep_aspect_ratio) File "object_detection_demo_yolov3_async.py", line 233, in get_objects out_blob = out_blob.buffer.reshape(net.layers[net.layers[layer_name].parents[0]].out_data[0].shape) KeyError: 'detector/yolo-v4-tiny/strided_slice/Split.0'

Any idea? Thank you in advance!

4444borja commented 3 years ago

@TNTWEN Hello! The problem, as you said, was because I was using an earlier OpenVino installation than the one required (2020R4). The problem persisted because, after updating OpenVino, I was testing on a model converted with the earlier version instead of reconverting it to OpenVino with 2020R4. Apologies for the mistake and thank you