-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenCV(3.4.5) + DNN (-215:Assertion failed) separator_index < line.size() in function 'ReadDarknetFromCfgStream' #1
Comments
Did you set the number of anchors to 6?. Tiny yolo uses 6 anchors instead of 9 anchors in case of normal Yolo here |
Though i tried anchor values to be 6 and 9 still it is not working, the same error is being show ...kindly help me out @tahaemara |
Hi, if you are using mac I found that if you use the textEdit.app, it adds a few lines at the top(you can't see them unless you use another editor) that are causing an issue, simply remove them and it will be fine. |
I have set following in yolov3-tiny.cfg [yolo] [yolo] still I get the error: Traceback (most recent call last): I have also checked whether any extra line is added. I am on Ubuntu 16.04 |
Did you able to solve the problem? |
This issue shall be reopened. |
I have the same problem net = cv2.dnn.readNetFromDarknet(_net_weights_path, _net_cfg_path) Have any idea? Please tell me more |
@gmatesunny did you check what I said before, do that if you are using mac |
HI. I have run my program on Vstudio Another suggestion ? |
@ADLTU : I checked and it doesn't have extra lines. I am using vscode as editor. |
Hi it won’t appear there, I had the same problem open the file in terminal
and you’ll see.
Hadi
…On Wed, 8 Jan 2020 at 19:40, DocGrenas ***@***.***> wrote:
Hi.
I am using the yolov3.cfg
[image: Screen Shot 2020-01-08 at 1 38 38 PM]
<https://user-images.githubusercontent.com/59627002/72009887-600a9200-321c-11ea-9b20-fe0a7e4f0772.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1?email_source=notifications&email_token=AIDB4NK4YSFKN5COW5M7WN3Q4YTZVA5CNFSM4GOOIKB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEINXJSI#issuecomment-572224713>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIDB4NKTU3DUV2NFSLFUJ3TQ4YTZVANCNFSM4GOOIKBQ>
.
|
@DocGrenas Facing the exact same problem as this: net = cv2.dnn.readNetFromDarknet(_net_weights_path, _net_cfg_path) Have you managed to solve it? Thanks! |
Use absolute path, it would work. For example,For Loading Yolonet = cv2.dnn.readNetFromDarknet("/home/babu/darknet/cfg/yolov3-tiny.cfg","/home/babu/darknet/yolov3-tiny.weights") For Loading imageimg = cv2.imread("/home/babu/darknet/data/dog.jpg") |
I get this
|
I did this but still getting the same error... config_path = '/home/rozer/dev/ML Projects/YOLO_Object_Detection/yolov3.cfg'
weight_path = '/home/rozer/dev/ML Projects/YOLO_Object_Detection/yolov3.weights'
net = cv2.dnn.readNetFromDarknet(config_path, weight_path)
I tried all above steps, but nothing worked, can anyone help me with this... Thank You! |
Try using this yolov3.cfg file. You will have to unzip it first. |
Thank You it works |
Even i'm getting same error while performing prediction on trained YOLOv3 Tiny. I i have checked number of anchor are 6 only. Could someone help me on this please . I have trained model in my virtual machine Ubuntu 20.04 Command Error Traceback (most recent call last): |
Try with this yolov3-tiny.cfg file: |
Thannks @fadeos your cfg file worked...for me... |
Great! I hope you can move on and complete your project. |
the Original file that is on pjreddie's repo has been corrupted, please refer this one yolov3.cfg. |
Just check up your .cfg file carefully. In my case, I accidentally removed # before word Testing. When transfer configuration file from training mode to testing one, we can do very simple error inadvertently. |
I had the same issue and even trying with the new .cfg file did not work. OpenCv in its documentation states that the order of model and config arguments does not matter, HOWEVER in my case it did matter. First config file and then weights (for DarkNet). This works for me: |
I think this is due to a few |
I think the problem is that some of us are downloading the "PAGE OF FILE". not the file itself! I mean, for downloading the cfg file, don't use this link: |
ya that error gone but a new error came cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\darknet\darknet_io.cpp:933: error: (-213:The function/feature is not implemented) Transpose the weights (except for convolutional) is not implemented in function 'cv::dnn::darknet::ReadDarknetFromWeightsStream' |
Hi , I tried this method and this solved my problem but I want to talk about another solution. Configs are not broken. This is my idea. Just change your anchors from from your .cfg file. I put COCO anchors from yolov3-tiny.cfg to my cfg and it worked for me. You can try this options:
|
python3 yolo_opencv.py -c custom/yolov3-tiny.cfg -w backup/yolov3-tiny_120000.weights -cl custom/objects.names
['bola']
Traceback (most recent call last):
File "yolo_opencv.py", line 47, in
net = cv2.dnn.readNet(args.weights,args.config)
cv2.error: OpenCV(3.4.5) /io/opencv/modules/dnn/src/darknet/darknet_io.cpp:507: error: (-215:Assertion failed) separator_index < line.size() in function 'ReadDarknetFromCfgStream'
I have this error on try your code... In darknet we can Run inference, and get results. You know the reason?
The text was updated successfully, but these errors were encountered: