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
Assertion error: over-read yolo.weights #107
Comments
i guess u had used wrong weights, it didn't match with cfg. i tried with yolo.cfg & yolo.weights it worked fine. |
The 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:
Then run
|
Try training your network from scratch, the latest weights https://pjreddie.com/darknet/yolo/ don't seem to align with the cfg file. |
Could you provide instructions to train using yolo.cfg file. Thanks
…On Wed, Mar 29, 2017 at 12:20 PM, Dhruv-Mohan ***@***.***> 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
<#107 (comment)>,
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 |
@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, [convolutional] [region] 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: |
@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. Can anyone help me? |
I have the same problem using this git's code https://github.com/bendidi/Tracking-with-darkflow with tiny-yolo |
@hyperfraise |
facing the same issue. i tried to use weights from your google drive with corresponding .cfg, worked until i tried to change num of classes to 1 (=> filters in last layer = 30). Is there still a chance to train on custom num of classes with pretrained model? |
I had the same problem when I trained Yolo with my own custom dataset from pjreddie's website and tried to run the resulting .weights file using darkflow. I had the problem of "Assertion Error : expect 268283952 bytes, found 268283956". Once I've changed self.offset = 20 on line 121 in loader.py in utils folder like @beerboaa said, it works fine. Thanks. |
@MartinBrisiak where you did you get the corresponding .cfg? |
nevermind, i have it running in one environment with the yolo.weights from @thtrieu and the yolo.cfg in this repo |
ye, it works,thanks a lot |
@beerboaa Thanks mahn..it worked |
It seems that the PJ Reddie files are not fully compatible, so I have to download the pre built weights from the provided link in the README: https://drive.google.com/drive/folders/0B1tW_VtY7onidEwyQ2FtQVplWEU |
where to find yolov2-voc.weights? is missing... any idea? |
there is mix with 2 different issues, the first one if there is different from the existing weight file and the configuration of exactly 4 bytes in this case you need to change the offset in line 121 to 20 (in my case is working with yolov2) the second case if the different is more than 4 bytes, this is wrong configuration file for weight file OR in case you want to train your own objects make sure that yolov2-voc.cfg exists in the configuration folder, i attach the one that resolve the issue |
for me it not work, any other ideas? :( |
Hi, |
To deal with the error
just run
|
Regarding the assertion error, its probably due to the mismatch of the configuration file and the weights. So, I found a hack around it. Use this notebook by Zoltan Szabo and replace the original cfg file with this one. Let the weights remain same. Now, the final change you must make, is to the text file containing the class names. For this, go to the class names file maintained by pj reddie and paste them to the text file present in Now simply run the command that you were running And you should get the desired protobuf file 😋 |
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/
The text was updated successfully, but these errors were encountered: