darknet icon indicating copy to clipboard operation
darknet copied to clipboard

Erro:Loading weights from yolov31.weights...Couldn't open file: yolov31.weights

Open xiaotongnii opened this issue 6 years ago • 17 comments

Rrecently,study object detection,hope to use to arrange Yolov3 on Ubuntu1604 in the virtual machine. However,appear some Erro, make me in troble,hope to give some tips!

Envirnment :PC configure:Core(TM)i5-4200 CPU Running Env: virtual machine14 、Ubuntu1604、 Aim :arrange Yolov3 on Ubuntu1604 in the virtual machine. Time:20181123:17:20

step: 1、git clone https://github.com/pjreddie/darknet 2、cd darknet make 3、wget https://pjreddie.com/media/files/yolov3.weights 4、./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg

ERRO: nxt001@ubuntu:/opt/darknet$ ./darknet detect cfg/yolov3.cfg yolov31.weights data/dog.jpg layer filters size input output 0 conv 32 3 x 3 / 1 608 x 608 x 3 -> 608 x 608 x 32 0.639 BFLOPs 1 conv 64 3 x 3 / 2 608 x 608 x 32 -> 304 x 304 x 64 3.407 BFLOPs 2 conv 32 1 x 1 / 1 304 x 304 x 64 -> 304 x 304 x 32 0.379 BFLOPs 3 conv 64 3 x 3 / 1 304 x 304 x 32 -> 304 x 304 x 64 3.407 BFLOPs 4 res 1 304 x 304 x 64 -> 304 x 304 x 64 5 conv 128 3 x 3 / 2 304 x 304 x 64 -> 152 x 152 x 128 3.407 BFLOPs 6 conv 64 1 x 1 / 1 152 x 152 x 128 -> 152 x 152 x 64 0.379 BFLOPs 7 conv 128 3 x 3 / 1 152 x 152 x 64 -> 152 x 152 x 128 3.407 BFLOPs ...... 98 route 97 36 99 conv 128 1 x 1 / 1 76 x 76 x 384 -> 76 x 76 x 128 0.568 BFLOPs 100 conv 256 3 x 3 / 1 76 x 76 x 128 -> 76 x 76 x 256 3.407 BFLOPs 101 conv 128 1 x 1 / 1 76 x 76 x 256 -> 76 x 76 x 128 0.379 BFLOPs 102 conv 256 3 x 3 / 1 76 x 76 x 128 -> 76 x 76 x 256 3.407 BFLOPs 103 conv 128 1 x 1 / 1 76 x 76 x 256 -> 76 x 76 x 128 0.379 BFLOPs 104 conv 256 3 x 3 / 1 76 x 76 x 128 -> 76 x 76 x 256 3.407 BFLOPs 105 conv 255 1 x 1 / 1 76 x 76 x 256 -> 76 x 76 x 255 0.754 BFLOPs 106 yolo Loading weights from yolov31.weights...Couldn't open file: yolov31.weights

Ps: 1、nxt001@ubuntu:/opt/darknet$ ls backup darknet examples libdarknet.a LICENSE LICENSE.gen LICENSE.meta LICENSE.v1 obj README.md scripts cfg data include libdarknet.so LICENSE.fuck LICENSE.gpl LICENSE.mit Makefile python results src 2、nxt001@ubuntu:/opt/darknet/cfg$ ls .... yolov3.cfg yolov3.weights .... 3、 vim Makefile (no modify) GPU=0 CUDNN=0 OPENCV=0 OPENMP=0 DEBUG=0

ARCH= -gencode arch=compute_30,code=sm_30
-gencode arch=compute_35,code=sm_35
-gencode arch=compute_50,code=[sm_50,compute_50]
-gencode arch=compute_52,code=[sm_52,compute_52]

-gencode arch=compute_20,code=[sm_20,sm_21] \ This one is deprecated?

This is what I use, uncomment if you know your arch and want to specify

ARCH= -gencode arch=compute_52,code=compute_52

VPATH=./src/:./examples SLIB=libdarknet.so ALIB=libdarknet.a EXEC=darknet OBJDIR=./obj/

CC=gcc CPP=g++ NVCC=nvcc AR=ar ARFLAGS=rcs OPTS=-Ofast LDFLAGS= -lm -pthread COMMON= -Iinclude/ -Isrc/ CFLAGS=-Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC .......

xiaotongnii avatar Nov 23 '18 09:11 xiaotongnii

The error msg says it can't open yolov31.weights. Do you have this file? The command line shows you're using yolov3.weights. Something's not right here.

PeterQuinn925 avatar Nov 23 '18 15:11 PeterQuinn925

The error msg says it can't open yolov31.weights. Do you have this file? The command line shows you're using yolov3.weights. Something's not right here.

Frist,thanks for your rely. In fact, this file(yolov3.weights) exist in the /opt/darknet/cfg

xt001@ubuntu:/opt/darknet/cfg$ ls
yolov3.cfg
yolov3.weights 

xiaotongnii avatar Nov 24 '18 02:11 xiaotongnii

Yeah, but the error msg you posted says it's looking for yolov31.cfg. That's kind of odd.

PeterQuinn925 avatar Nov 24 '18 04:11 PeterQuinn925

Yeah, but the error msg you posted says it's looking for yolov31.cfg. That's kind of odd.

yea,I try to take some ways to solve it

xiaotongnii avatar Nov 25 '18 06:11 xiaotongnii

I have meet same problem. But its easy to solve. I think you should make same mistake with me,just put yolov3.weights file into /cfg. You should put weights file in /darknet, and you can solve it!

flyingbird93 avatar Nov 30 '18 07:11 flyingbird93

I have meet same problem. But its easy to solve. I think you should make same mistake with me,just put yolov3.weights file into /cfg. You should put weights file in /darknet, and you can solve it! yea,it is a same mistake with you, , according to you ,be solved,thanke you

xiaotongnii avatar Feb 25 '19 07:02 xiaotongnii

same problem here --> solved by putting yolov3.weights in /darknet

ottovotto avatar Apr 18 '19 10:04 ottovotto

Be sure about the path of your weights file, had the same problem and in my case reason was the path to weights.

ghost avatar May 21 '19 13:05 ghost

same problem here! I changed the running command to : ./darknet detect cfg/yolov3.cfg cfg/yolov3.weights data/dog.jpg add /cfg in front of yolov3.weights, everything fine!

Aaayue avatar May 28 '19 01:05 Aaayue

Incorrect path can lead to this problem.

saangaa avatar Aug 26 '19 06:08 saangaa

The error msg says it can't open yolov31.weights. Do you have this file? The command line shows you're using yolov3.weights. Something's not right here.

Frist,thanks for your rely. In fact, this file(yolov3.weights) exist in the /opt/darknet/cfg nxt001@ubuntu:/opt/darknet/cfg$ ls .... yolov3.cfg yolov3.weights ....

actually yolov3.weights must be within folder, in your case it's outside the folder....yeahh i did same mistake too.

vkrytpo avatar Jan 25 '20 04:01 vkrytpo

Have placed weights in right path but issue persists in windows 10. Please help

Command: darknet_no_gpu.exe detector test cfg\coco.data cfg\yolov3.cfg yolov3.weights data\test-image.jpg

Loading weights from yolov3.weights...Couldn't open file: yolov3.weights

puttapraneeth avatar Jul 17 '20 18:07 puttapraneeth

Download it from here: https://pjreddie.com/media/files/yolov3.weights Then move it to /darknet

ammu-007 avatar Aug 05 '20 07:08 ammu-007

Have placed weights in right path but issue persists in windows 10. Please help

Command: darknet_no_gpu.exe detector test cfg\coco.data cfg\yolov3.cfg yolov3.weights data\test-image.jpg

Loading weights from yolov3.weights...Couldn't open file: yolov3.weights

Have placed weights in right path but issue persists in windows 10. Please help

Command: darknet_no_gpu.exe detector test cfg\coco.data cfg\yolov3.cfg yolov3.weights data\test-image.jpg

Loading weights from yolov3.weights...Couldn't open file: yolov3.weights

Hi,

I was also facing the same issue. There are two darknet folders which might be causing the confusion. I was placing the images and weights inside /darknet initially and i was getting the error. It should be placed inside darknet/build/darknet/x64/weights.

And it worked for me.

sandheepgopinath avatar Sep 16 '20 04:09 sandheepgopinath

@sandheepgopinath This actually worked for me

koushik2001 avatar Apr 07 '21 09:04 koushik2001

Download it from here: https://pjreddie.com/media/files/yolov3.weights Then move it to /darknet

Thanks a lot, this is working for me. ;)

chenxy1988 avatar Nov 26 '21 03:11 chenxy1988

I have face same problem , add the yolov3.weights to ./cfg then run the syntax ./darknet detect cfg/yolov3.cfg cfg/yolov3.weights data/dog.jpg error will be resolved.

thanishap avatar Apr 09 '22 15:04 thanishap

good

xiaotongnii avatar Nov 13 '23 05:11 xiaotongnii