darkflow icon indicating copy to clipboard operation
darkflow copied to clipboard

tiny yolo config and weights mismatch

Open itsayush opened this issue 9 years ago • 2 comments

I have modified the tiny yolo config to just work with 1 label and i want to retrain it with pre trained weights. When i try to this, i get this error

python3 flow --train --model cfg/tiny-yolo-voc.cfg --lr 1e-3 -momentum 0.9 --epoch 50000000 --save 20000 --savepb --dataset ~/train/ --annotation ~/train/ --threshold 0.01 --trainer adam --gpu 1.0 --batch 50 --load bin/tiny-yolo-voc.weights

Parsing ./cfg/tiny-yolo-voc.cfg Parsing cfg/tiny-yolo-voc.cfg Loading bin/tiny-yolo-voc.weights ... Traceback (most recent call last): File "flow", line 48, in tfnet = TFNet(FLAGS) File "/home/cortanavisionsvc/src/cv-darkflow/net/build.py", line 47, in init darknet = Darknet(FLAGS) File "/home/cortanavisionsvc/src/cv-darkflow/dark/darknet.py", line 27, in init self.load_weights() File "/home/cortanavisionsvc/src/cv-darkflow/dark/darknet.py", line 82, in load_weights wgts_loader = loader.create_loader(*args) File "/home/cortanavisionsvc/src/cv-darkflow/utils/loader.py", line 105, in create_loader return load_type(path, cfg) File "/home/cortanavisionsvc/src/cv-darkflow/utils/loader.py", line 19, in init self.load(*args) File "/home/cortanavisionsvc/src/cv-darkflow/utils/loader.py", line 77, in load walker.offset, walker.size) AssertionError: expect 63082056 bytes, found 63471556

Is there someone who has tried this and has worked ?

My config looks like this

[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 softmax=1 jitter=.2 rescore=1

itsayush avatar May 16 '17 01:05 itsayush

Worked when i renamed the config file and had a config file name with same name as .weights. Had to pass --config cfg/

itsayush avatar May 16 '17 02:05 itsayush

So did you write: python3 flow --train --config cfg/ --model cfg/tiny-yolo-voc.cfg --lr 1e-3 -momentum 0.9 --epoch 50000000 --save 20000 --savepb --dataset ~/train/ --annotation ~/train/ --threshold 0.01 --trainer adam --gpu 1.0 --batch 50 --load bin/tiny-yolo-voc.weights

Because I am getting the same Assertion error.

kpiyush16 avatar May 23 '18 13:05 kpiyush16