Cannot convert weights/cfg to pb model
./flow --model tiny-yolo-voc-original.cfg --load tiny-yolo-voc.weights --savepb
...
AssertionError: labels.txt and tiny-yolo-voc-original.cfg indicate inconsistent class numbers
this https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/android/src/org/tensorflow/demo/DetectorActivity.java#L69
also doesn't work:
./flow --model tiny-yolo-voc-original.cfg --load tiny-yolo-voc.weights --savepb --verbalise=True
ERROR - Invalid argument: --verbalise=True
In regard to your first problem, when darkflow sees one of the default .cfg names it will load the labels from it's own array (or external file in the case of the COCO dataset) - i.e. when it sees a recognized .cfg it will ignore what is set in labels.txt. You can see what the recognized .cfg names are here. In your case you are using an unrecognized .cfg name tiny-yolo-voc-original.cfg which is not in that array. Thus darkflow will try to load the labels from labels.txt and in your case it is finding the wrong number of labels. If you are trying to load the VOC labels, either rename your .cfg file to tiny-yolo-voc.cfg so that it's recognized and darkflow automatically loads from the VOC labels or manually copy the VOC labels into labels.txt.
In regard to your second problem, I wrote a custom CLI handler for darkflow and assigning values using = is currently not supported. To set --verbalise to true either simply use --verbalise on its own or use --verbalise true.
Got it. I also tried to convert my own trained tiny yolo with 1 classes and I couldn't (even if I edited labels.txt and put only one name) because as you said if cfg is named as tiny-yolo-voc.cfg then darkflow searches from it's own array. I renamed it in something else and it worked.
Thanks!
Hello, I am currently training one class, but the load of the yolo-small.weights file does not load during the training.
this is my command:yolo-me-small.cfg --load bin/yolo-small.weights --train --annotation CAR/Annotations --dataset CAR/JPEGImages
error:
Parsing ./cfg/yolo-qr-small.cfg
Parsing cfg/yolo-qr-small.cfg
Loading bin/yolo-qr-small.weights ...
Traceback (most recent call last):
File "./flow", line 6, in
cliHandler(sys.argv)
File "/home/xwlab/darkflow/darkflow/cli.py", line 22, in cliHandler
tfnet = TFNet(FLAGS)
File "/home/xwlab/darkflow/darkflow/net/build.py", line 58, in __init__
darknet = Darknet(FLAGS)
File "/home/xwlab/darkflow/darkflow/dark/darknet.py", line 27, in __init__
self.load_weights()
File "/home/xwlab/darkflow/darkflow/dark/darknet.py", line 82, in load_weights
wgts_loader = loader.create_loader(args)
File "/home/xwlab/darkflow/darkflow/utils/loader.py", line 105, in create_loader
return load_type(path, cfg)
File "/home/xwlab/darkflow/darkflow/utils/loader.py", line 19, in __init__
self.load(args)
File "/home/xwlab/darkflow/darkflow/utils/loader.py", line 77, in load
walker.offset, walker.size)
AssertionError: expect 360624512 bytes, found 375881736
My problem was removing the trailing breakline in the labels.txt file. It counted the new empty line as an extra class
I used 7 classes cfg file with 60 filters. The labels
labels.txt
.txt file also contains 7 classes but even though there is error which is as follows:
AssertionError: labels.txt and cfg/tiny-yolo-voc-7c.cfg indicate inconsistent class numbers
Most helpful comment
In regard to your first problem, when darkflow sees one of the default
.cfgnames it will load the labels from it's own array (or external file in the case of the COCO dataset) - i.e. when it sees a recognized.cfgit will ignore what is set inlabels.txt. You can see what the recognized.cfgnames are here. In your case you are using an unrecognized.cfgnametiny-yolo-voc-original.cfgwhich is not in that array. Thus darkflow will try to load the labels fromlabels.txtand in your case it is finding the wrong number of labels. If you are trying to load the VOC labels, either rename your.cfgfile totiny-yolo-voc.cfgso that it's recognized and darkflow automatically loads from the VOC labels or manually copy the VOC labels intolabels.txt.In regard to your second problem, I wrote a custom CLI handler for darkflow and assigning values using
=is currently not supported. To set--verbaliseto true either simply use--verbaliseon its own or use--verbalise true.