Open sunsided opened 7 years ago
This comment on #107 suggests that training from scratch might solve this issue. I retrained the network using darknet
an converted it again, but do still receive the same error.
This comment suggests to change self.offset = 16
to self.offset = 20
in utils/loader.py
's weights_walker.__init__()
method. If I do that the error disappears but I have no idea if that is a smart thing to do.
I meet this problems too,I think it is caused by the unpair between .weight and .cfg , maybe it is a little cue, but I have no idea to solve it,so sorry
Modify loader.py under darkflow/utils may help. Change the line 121 from self.offset = 16 to self.offset = 20~~~ This work for me, hope help~
thank you for your help,i have solve it ,thankyou again
发自我的 iPhone
在 2017年11月16日,03:52,shangliy notifications@github.com 写道:
Modify loader.py under darkflow/utils may help. Change the line 121 from self.offset = 16 to self.offset = 20~~~ This work for me, hope help~
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
i have Changed the line 121 from self.offset = 16 to self.offset = 20! but the same error not disappear!
why should we change this number "self.offset" value
My guess is that the offset that deals with the difference between c and python but I could be wrong. Can you try reduce the offset to 12 to keep the expected bytes equal to the actual bytes. Let me know how that goes.
This is my training output used darkflow, please tell me, what is the format of the file, why not get the .CKPT format file! How can I generate the required weight file for tensorflow?(.ckpt)
@yw455801125 how did you get it working? You can convert it by using --savepb or something similar. It is in the Readme.
@yw455801125 The weights I used to transform are from Darknet not darkflow. The weights storage format from Darkflow and Darknet are different. So, I guess my solution may not work on your case.
@yw455801125 I think it's because the size of the header of the most up-to-date yolo v2 weights changed from 16 bytes to 20 bytes, so the weights_walker
doesn't reach the end of the file because it expects an older header size. If I hit the same problem, I'd try to change the self.offset
from 16 to file size - expected size
, in case the weight files change again.
@yw455801125 in case you have not solved this issue yet or for others , you need to upgrade your darkflow installation after your modification of darkflow/utils/loader.py you can use: pip install . --upgrade anyway i got another error now with labels mismatches: /anaconda2/lib/python2.7/site-packages/darkflow/net/yolo/init.py", line 24, in constructor ).format(meta['model']) AssertionError: labels.txt and ../darknet/cfg/yolov2-tiny.cfg indicate inconsistent class numbers
go the same error AssertionError: labels.txt and ../darknet/cfg/yolov2-tiny.cfg indicate inconsistent class numbers please someone have any answer REPLY
@HsGaurav to fix error in labels i just link the labels.txt to the corresponding file with list of label used on the dataset on which the network as been trained. for example for yolov2-voc I linked to darknet/data/voc.names etc...
@fbadaud how do you link a file
Error :- AssertionError: expect 63184556 bytes, found 63184560
Solution : " ./darkflow/utils/loader.py" at line 121, you will find self.offset= 16 or 20. update to be done : - found 63184560 - expect 63184556 = 4, then add 4 to self.offset = add this 4 (or any other value) diff to 16 or 20 and then run your command again.
Best of Luck, it work for me, hope it may work for you as well, keep helping other.
I'm getting a rather weird error trying to convert a
darknet
trained Tiny YOLO (adjusted model, transfer learned using a custom dataset) usingflow --savepb
, which complains about finding an unexpected file size. The size difference appears to be exactly four bytes though:I was trying it with different versions of TensorFlow, specifically 1.0.1 and 1.3.1, but that didn't change anything. Does anyone have an idea what could trigger this issue?