Skip to content
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

expect 202355760 bytes, found 203934260 #900

Open
maliifat opened this issue Sep 18, 2018 · 11 comments
Open

expect 202355760 bytes, found 203934260 #900

maliifat opened this issue Sep 18, 2018 · 11 comments

Comments

@maliifat
Copy link

C:\Users\BFOSS\Desktop\darkflow-master>python flow --model cfg/yolov2.cfg --load bin/yolov2.weights --train --annotation new_model_data/annotations --dataset new_model_data/images --gpu 0.8 --epoch 300

Parsing ./cfg/yolov2.cfg
Parsing cfg/yolov2.cfg
Loading bin/yolov2.weights ...
Traceback (most recent call last):
File "flow", line 6, in
cliHandler(sys.argv)
File "C:\Users\BFOSS\Desktop\darkflow-master\darkflow\cli.py", line 26, in cliHandler
tfnet = TFNet(FLAGS)
File "C:\Users\BFOSS\Desktop\darkflow-master\darkflow\net\build.py", line 58, in init
darknet = Darknet(FLAGS)
File "C:\Users\BFOSS\Desktop\darkflow-master\darkflow\dark\darknet.py", line 27, in init
self.load_weights()
File "C:\Users\BFOSS\Desktop\darkflow-master\darkflow\dark\darknet.py", line 82, in load_weights
wgts_loader = loader.create_loader(*args)
File "C:\Users\BFOSS\Desktop\darkflow-master\darkflow\utils\loader.py", line 105, in create_loader
return load_type(path, cfg)
File "C:\Users\BFOSS\Desktop\darkflow-master\darkflow\utils\loader.py", line 19, in init
self.load(*args)
File "C:\Users\BFOSS\Desktop\darkflow-master\darkflow\utils\loader.py", line 77, in load
walker.offset, walker.size)
AssertionError: expect 202355760 bytes, found 203934260

how can I solve it ?

@yizhou-wang
Copy link

yizhou-wang commented Sep 19, 2018

I got a similar error.

AssertionError: expect 202417260 bytes, found 202417264

This issue #802 also mentioned this error.

@dudqls1994
Copy link

did you change label? I also have this error

@abhishek-s-jha
Copy link

abhishek-s-jha commented Oct 9, 2018

This error arises because of mismatch of configuration file and loaded weight.
Simple way to solve this is to edit self.offset value in loader.py present at darkflow/darkflow/utils/

updated self.offset = old_offset_value + (found_value - expected_value)

And also check that number of classes in cfg file is equal to the number of labels present in labels.txt

@seek-ing
Copy link

1、首先,我们在ubuntu下先用anaconda2(版本是2还是3不影响)安装了tensorflow.
2、darkflow要求的安装环境是Python3,那么把anaconda2里的Python2升级到python3.5就行,Ubuntu系统默认是自带python2.7的,在使用darkflow时,用source activate py35进入Python3.5环境再使用flow命令就行。
3、接下来,你可以在任何地方安装darkflow,但是要在py35环境下安装,换Python环境source activate py35,然后安装好你会看到darkflow的文件夹,这个文件夹没用,在安装darkflow的时候会自动拷贝到anaconda2/envs/py34/lib/python3.5/site-packages/darkflow/utils(我Python3.5命名的时候手抖,弄成了py34),要改的是上述目录下loader.py第121行,把self.offset = 16改成self.offset = 20

@me6ran
Copy link

me6ran commented Jan 24, 2019

@abhishek795jha
I got the same error, and changed the self.offset to the calculated number,
I can confirm that the error got disappeared, but after training I saw that the model is way off and cannot detect the trained object at all.
so I found that this solution is not gonna work.
any experience guys?

@shalin51
Copy link

@abhishek795jha
I got the same error, and changed the self.offset to the calculated number,
I can confirm that the error got disappeared, but after training I saw that the model is way off and cannot detect the trained object at all.
so I found that this solution is not gonna work.
any experience guys?

I had same problem. My calculated value was 820820 and it didn't detect anything.

I changed back classes to same number (in my case it was 80) and downloaded 80 labels. after that the calculated number was 4 and it started detecting.

I didn't have the time to exactly calculate the bytes, but from my experience I can say that it depends on number of filters.

@hakS07
Copy link

hakS07 commented Mar 27, 2019

@shalin51
Hi,i want to ask if you solve this problem because i have exactly the same problem as you
updated self.offset = old_offset_value + (found_value - expected_value)=16+769504=769520
and the calasses=5
filtres=50=5(5+5)
AssertionError: expect 44179096 bytes, found 44948600
but i stil have the same pb
any help

@abhishek-s-jha
Copy link

@me6ran
Didn't happen with my training. Can you describe your data and hyperparameter, if possible

@Rockstar256
Copy link

I don't know whether it's a good idea or not. But it works if you comment out that assert statement.

@DigvijaySingh7720
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests