user11394181
user11394181

Reputation:

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?

Upvotes: 4

Views: 43427

Answers (6)

Ankita Bagaria
Ankita Bagaria

Reputation: 1

Download the file 'yolov3.weights' from the link and save it into your working directory: https://pjreddie.com/darknet/yolo/

Upvotes: 0

Gaurao Mate
Gaurao Mate

Reputation: 23

I have the same problem. I have tried this and it works for me. Just Give the path where the yolov3.weights, coco.names etc in your darknet folder. Like, right-click where you stored the file and copy the path. Like drive/darkflow/coco.names

Upvotes: 0

PKS
PKS

Reputation: 773

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"

Upvotes: 4

Mutaealim
Mutaealim

Reputation: 137

You may have using opencv 4 version.Try installing opencv-3.4.2.*

pip install opencv-python==3.4.2.16

Upvotes: 0

bhavesh singh
bhavesh singh

Reputation: 51

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

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

Upvotes: 2

neuromantik
neuromantik

Reputation: 31

I had a similar error and the problem was in file paths. Absolute file paths solved the issue.

Upvotes: 0

Related Questions