>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'

为什么会出现解析错误?谁能帮我解决这个问题?

最佳答案

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

运行此命令,然后将yolo.weight文件保存在yolov3-coco中。

10-08 14:20