Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to parse netParameter file

>py yolo.py --video-path='F:/Data_Science/Python37/Scripts/YOLO/videos/lowres.mp4'
Traceback (most recent call last):
  File "yolo.py", line 88, in <module>
    net = cv.dnn.readNetFromDarknet(FLAGS.config, FLAGS.weights)
cv2.error: OpenCV(4.0.1) C:\projects\opencv-python\opencv\modules\dnn\src\darknet\darknet_importer.cpp:214: error:  
 (-212:Parsing error) Failed to parse NetParameter file: ./yolov3- 
 coco/yolov3.weights in function 'cv::dnn::dnn4_v20181221::readNetFromDarknet'

why am I getting a parse error? Can anyone help me fix this?


2 Answers

Add the absolute path of the cgf and weight files while adding them

example : modelConfiguration = "D:/yoloObj/res/yolov2-tiny.cfg" modelWeights = "D:/yoloObj/res/yolov3-tiny.weights"

like image 159
PKS Avatar answered Nov 01 '25 02:11

PKS


! wget "https://pjreddie.com/media/files/yolov3.weights"

Run this command and save the yolo.weight file in yolov3-coco.

like image 31
bhavesh singh Avatar answered Nov 01 '25 01:11

bhavesh singh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!