# Yolov3 Python Error

**URL:** <https://forum.opencv.org/t/yolov3-python-error/5328>\
**Category:** Python\
**Tags:** dnn\
**Created:** [September 23, 2021, 12:32am UTC](https://forum.opencv.org/t/yolov3-python-error/5328 "2021-09-23T00:32:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsarrett](https://avatars.discourse-cdn.com/v4/letter/b/a9a28c/32.png) [@bsarrett](https://forum.opencv.org/u/bsarrett)\
**Post date:** [September 23, 2021, 12:32am UTC](https://forum.opencv.org/t/yolov3-python-error/5328/1 "2021-09-23T00:32:32Z")

</div>

I am trying to load the yolov3 object detector in python on windows operating system and I cannot even run 2 lines of code without opencv creating errors. Yolo cfg and weights file downloaded from official website.

Here is the code:

import cv2  
net = cv2.dnn.readNet(“yolov3-320.weights”, “yolov3-320.cfg”)

Error:

Traceback (most recent call last):  
File “C:\Users\Blake\PycharmProjects\YOLO\_AGAIN\main.py”, line 3, in   
net = cv2.dnn.readNet(“yolov3-320.weights”, “yolov3-320.cfg”)  
cv2.error: OpenCV(4.3.0) C:\Users\Blake\AppData\Local\Temp\pip-install-m95o04se\opencv-python\_fae686c32a8a46c980efa493995d67c9\opencv\modules\dnn\src\darknet\darknet\_io.cpp:847:errror: (-213:The function/feature is not implemented) Transpose the weights (except for convolutional) is not implemented in function ‘cv::dnn::darknet::ReadDarknetFromWeightsStream’

Please I been working on this for weeks with consisten errors in opencv functions.

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [September 23, 2021, 9:50am UTC](https://forum.opencv.org/t/yolov3-python-error/5328/2 "2021-09-23T09:50:59Z")

</div>

> [@bsarrett](#):
>
> Yolo cfg and weights file downloaded from official website.

hmm, your [files do not exist here](https://pjreddie.com/darknet/yolo/)  
(all links go to the [same weights file](https://pjreddie.com/media/files/yolov3.weights) )

related:

> [@readNetFromDarkNet Throwing Exception](https://forum.opencv.org/t/readnetfromdarknet-throwing-exception/5239/):
>
> Hello this is my first time posting, if I am missing anything please ask. I am trying to run yolov3 object detection algorithm in opencv on a cpu in C++ Visual Studio 2019. Here is my C++ Code: #include \<iostream\> #include \<fstream\> #include \<opencv2/core.hpp\> #include \<opencv2/highgui.hpp\> #include \<opencv2/imgcodecs.hpp\> #include \<opencv2/dnn.hpp\> using namespace std; int main() { cv::VideoCapture webcam(0); cv::Mat frame; webcam.read(frame); vector\<string\> classNames; …

---

<div class="post-metadata">

**Author:** ![bsarrett](https://avatars.discourse-cdn.com/v4/letter/b/a9a28c/32.png) [@bsarrett](https://forum.opencv.org/u/bsarrett)\
**Post date:** [September 23, 2021, 3:19pm UTC](https://forum.opencv.org/t/yolov3-python-error/5328/3 "2021-09-23T15:19:50Z")

</div>

That “related” forum was also posted by me, but now I trying to use python to just get something working…

I just renamed my weights file and cfg to make things clear.

Why can’t opencv run this code?

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [September 25, 2021, 10:01am UTC](https://forum.opencv.org/t/yolov3-python-error/5328/4 "2021-09-25T10:01:03Z")

</div>

sorry, i cannot reproduce it (neither from c++ nor python)  
(but id point at the data, not the code)
