Asadullah-Dal17 / Yolov4-Detector-and-Distance-Estimator

97 stars 27 forks source link

[ WARN:0@0.390] global /io/opencv/modules/dnn/src/dnn.cpp (1483) setUpNet DNN module was not built with CUDA backend; switching to CPU #10

Open BraholliKristi opened 2 years ago

BraholliKristi commented 2 years ago

[ WARN:0@0.390] global /io/opencv/modules/dnn/src/dnn.cpp (1483) setUpNet DNN module was not built with CUDA backend; switching to CPU Traceback (most recent call last): File "/home/braholli/Documents/Yolov4-Detector-and-Distance-Estimator-master/DistanceEstimation.py", line 72, in mobile_data = object_detector(ref_mobile) File "/home/braholli/Documents/Yolov4-Detector-and-Distance-Estimator-master/DistanceEstimation.py", line 42, in object_detector label = "%s : %f" % (class_names[classid[0]], score) IndexError: invalid index to scalar variable.

BraholliKristi commented 2 years ago

I have Successfully installed opencv-contrib-python-4.5.5.64

Asadullah-Dal17 commented 2 years ago

Make sure to choose the correct environment, while running the code.

hfatima08 commented 1 year ago

what do you mean by choosing the correct environment? What should i do to solve this issue? I'm using pycharm to run your code.

Asadullah-Dal17 commented 1 year ago

a python Virtual Envnieorment in which you have installed required version of opencv

hfatima08 commented 1 year ago

but the version you have mentioned is not being installed in the environment

Asadullah-Dal17 commented 1 year ago

have you got any specific error message while installation process?

vlasov01 commented 11 months ago

Hi, I've got the same error. I've applied an answer from https://stackoverflow.com/questions/32978575/how-to-fix-indexerror-invalid-index-to-scalar-variable in three places. But I think without CUDA it is too slow for my RPi4. And I got another error: [h264 @ 0x10ad7e20] error while decoding MB 45 2, bytestream -13 Traceback (most recent call last): File "/home/swim/Yolov4-Detector-and-Distance-Estimator/DistanceEstimation.py", line 92, in data = object_detector(frame) ^^^^^^^^^^^^^^^^^^^^^^ File "/home/swim/Yolov4-Detector-and-Distance-Estimator/DistanceEstimation.py", line 35, in object_detector classes, scores, boxes = model.detect(image, CONFIDENCE_THRESHOLD, NMS_THRESHOLD) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cv2.error: OpenCV(4.6.0) ./modules/imgproc/src/resize.cpp:4052: error: (-215:Assertion failed) !ssize.empty() in function 'resize'