Assertion error: over-read yolo.weights
I tried to run ./flow --test test/ --model cfg/yolo.cfg --load yolo.weights --gpu 1.0
I get loading yolo.weights .... and then assertion error: Over-read yolo.weights.
However, when I run the same command with tiny-yolo.cfg and tiny-yolo.weights it works. I downloaded the weights file from https://pjreddie.com/darknet/yolo/
i guess u had used wrong weights, it didn't match with cfg. i tried with yolo.cfg & yolo.weights it worked fine. however when i train yolo-voc.cfg with custom class, i get the same error message with my trained weights. i would appreciate if someone can explain what this error mean.
The .weights parser follow .cfg layer by layer, reading the corresponding chunk of bytes from .weights, but then there is still layer to read while the parser has already reach the end of .weights; that is when you have the assertion error.
Please give the command that leads to this error. If you want to custom your class, then there is a few places to make modifications:
- Number of filters in the last
convlayer in.cfg classnumber inregionlayerlabels.txt
Then run
./flow --model cfg/model.cfg --load bin/model.weights --train
Try training your network from scratch, the latest weights https://pjreddie.com/darknet/yolo/ don't seem to align with the cfg file. I've run into the same problem with yolo.weights and yolo-voc.weights, however my custom trained network's weights work just fine
Could you provide instructions to train using yolo.cfg file. Thanks
On Wed, Mar 29, 2017 at 12:20 PM, Dhruv-Mohan [email protected] wrote:
Try training your network from scratch, the latest weights https://pjreddie.com/darknet/yolo/ don't align with the cfg file. I've run into the same problem with yolo.weights and yolo-voc.weights, however my custom trained network's weights work just fine
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thtrieu/darkflow/issues/107#issuecomment-289999490, or mute the thread https://github.com/notifications/unsubscribe-auth/AZgJMHWUgCDnwlS_s1HY5RcBNrVSAWusks5rqf9CgaJpZM4Mrj84 .
same problem. use readme instruction with yolo.cfg and v2 weights of http://pjreddie.com/media/files/yolo-voc.weights
@kinhunt yolo.cfg and yolo-voc.weights don't match. Even the new yolo.weights does not match yolo.cfg, it seems the official YOLO site does not keep their files reliably.
@thtrieu thank you to clear out. do you know where to find the matching files?
@kinhunt i've hunted for many days and haven't found em. You're best best is to train from scratch
I can upload mine. Wait for ~ 24 hours.
@thtrieu good news. thank you
@Dhruv-Mohan @kinhunt see updated README, I uploaded some of the weights file.
got it thank you. it works
@thtrieu could you provide the steps you followed to trainj on coco dataset to generate yolo.weights file. I would liketo repeat the same and generate weights file for yolov2 on coco dataset.
Hi @thtrieu, I have followed steps you mentioned to retrain the model with custom number of classes
[convolutional] size=1 stride=1 pad=1 filters=30 activation=linear
[region] anchors = 1.08,1.19, 3.42,4.41, 6.63,11.38, 9.42,5.11, 16.62,10.52 bias_match=1 classes=1 coords=4 num=5
I also have just one label in label.txt. But when i run this with the tiny weights file i downloaded from your google share [https://drive.google.com/drive/folders/0B1tW_VtY7onidEwyQ2FtQVplWEU tiny-yolo-voc.weights] , it fails with assertion error
AssertionError: expect 63082056 bytes, found 63471556
Can you help me understand what might be wrong here.
I had a similar problem with a previously custom-trained weight from darknet, I copied the same .cfg file with the weight to try it on darkflow and got:
AssertionError: expect 202314760 bytes, found 202314764
It only differs by 4 bytes so am I missing some settings?
@deng1028 have you solved your problem yet? I have the same problem.
@helloGitHub1993 have you solved your problem yet? I have the same problem.
@helloGitHub1993 go into loader.py in utils folder ,then change self.offset = 20 on line 121
@beerboaa i used another way. flow -model cfg/yolo-new.cfg(replace it with your training cfg) --load -1 --imgdir yourimgdir. It works for me and you can have a try.By the way, you dont need to train again.
@itsayush have you solved your problem yet? I also followed the same steps as you and have the same problem with training custom data (1 class). I tried changing self.offset = 1 in loader.py, it didn't work. My command: flow --train --model cfg/tiny-yolo-voc-1c.cfg --load bin/tiny-yolo-voc.weights --annotation train/Annotations/ --dataset train/Images/ --config cfg/ --gpu 0.9 But it works well with: flow --imgdir sample_img/ --model cfg/tiny-yolo-voc.cfg --load bin/tiny-yolo-voc.weights --gpu 0.9 AssertionError: expect 63471541 bytes, found 63471556
Can anyone help me?