-
Notifications
You must be signed in to change notification settings - Fork 43
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
AssertionError: expect 202335260 bytes, found 203934260 #3
Comments
I modify the line self.offset = 16 in the ./darkflow/utils/loader.py file and replace with self.offset = 20. But can not solve the issue. |
cfg/yolo_custom.cfg parsing ./annotations/
|
looks like the weight file is broken, can you download and try one more shot? |
hi, have same problem. Just downloaded weights from link that u gave (working with your instructions https://towardsdatascience.com/yolov2-to-detect-your-own-objects-soccer-ball-using-darkflow-a4f98d5ce5bf), but nothing changed. What different can be wrong? |
i have try to download and try to train again, but stiill error. |
i have the same problem.. |
Yes I also have same problem. The deafult yolov2-tiny-voc.cfg file has filters=35 Here is my repo link: https://github.com/pdhruv93/RoadCrackDetector |
Good day! Мanaged to solve it by adjusting the values in the file ./darkflow/utils/loader.py necessary |
Hi, I also encountered the same error while studying this code. And after searching a little bit, I was finally able to solve it. first, problem is that the number of parameters in the weight file is different from the number of parameters in the cfg file. See this link for information about why changing the parameters in the weight file Link: thtrieu/darkflow#107 Perhaps this code would have created a cfg file based on an older version of the weight file. Therefore, we need to receive the previous version of the weight file. Link: https://pjreddie.com/darknet/yolo/ Change the load section of the main ipynb file by getting the file "yolov2.weight" from here. It can be solved with that. |
Hi, where did you get the previous version of the weight file? I tried "https://pjreddie.com/media/files/yolov2.weights" but it still not working. |
Hi, I think I wrote the same weight file with you. Please check if the error message also shows the same error message. If you get the same error message, you should try the cfg file with the file provided in the link. After try , If still raise same error Please Show me your options code and error message |
Hi, thanks for helping.
Here is the error msg.
Then, I try the cfg file "https://github.com/pjreddie/darknet/blob/master/cfg/yolov2.cfg" and change the region part. In this time, I can build the network, but training is still not working. Would you like to share your cfg file with me? |
I used this cfg file. If it does not work with this cfg file, we recommend customizing it in the existing yolo v2 file. You do not have to change a lot. Perhaps it only changed the number of classes and labels. Please note that this cfg has 2 classes, so you can change it by referring to the original link. |
It works! |
can you tell me, what did you adjust |
In darkflow/utils/loader.py
Make the adjustment according to the error that you have faced. |
if you found the answer useful, help me on stackoverflow. So that those who have the same problem will immediately find the solution. |
Thanks everyone for your help solving this !
However... Were you able to get to the ~0.5 mov avg loss the author claims? |
Thank you, this really solves my issue. |
Open
It worked for me. Finally, it will look like:
|
Parsing cfg/yolo_custom.cfg
Loading bin/yolo.weights ...
AssertionError Traceback (most recent call last)
in ()
----> 1 tfnet = TFNet(options)
~/anaconda3/lib/python3.6/site-packages/darkflow/net/build.py in init(self, FLAGS, darknet)
56
57 if darknet is None:
---> 58 darknet = Darknet(FLAGS)
59 self.ntrain = len(darknet.layers)
60
~/anaconda3/lib/python3.6/site-packages/darkflow/dark/darknet.py in init(self, FLAGS)
25 self.meta, self.layers = des_parsed
26
---> 27 self.load_weights()
28
29 def get_weight_src(self, FLAGS):
~/anaconda3/lib/python3.6/site-packages/darkflow/dark/darknet.py in load_weights(self)
80
81 args = [self.src_bin, self.src_layers]
---> 82 wgts_loader = loader.create_loader(*args)
83 for layer in self.layers: layer.load(wgts_loader)
84
~/anaconda3/lib/python3.6/site-packages/darkflow/utils/loader.py in create_loader(path, cfg)
103 load_type = checkpoint_loader
104
--> 105 return load_type(path, cfg)
106
107 class weights_walker(object):
~/anaconda3/lib/python3.6/site-packages/darkflow/utils/loader.py in init(self, *args)
17 self.src_key = list()
18 self.vals = list()
---> 19 self.load(*args)
20
21 def call(self, key):
~/anaconda3/lib/python3.6/site-packages/darkflow/utils/loader.py in load(self, path, src_layers)
75 assert walker.offset == walker.size,
76 'expect {} bytes, found {}'.format(
---> 77 walker.offset, walker.size)
78 print('Successfully identified {} bytes'.format(
79 walker.offset))
AssertionError: expect 202335260 bytes, found 203934260
The text was updated successfully, but these errors were encountered: