Darkflow: How to receive .pb file with the least efforts?

Created on 17 Jan 2017  路  8Comments  路  Source: thtrieu/darkflow

Thanks for repository! Sorry, I don't understand anything from the documentation.
So, I have an iOS tensorflow app, it works with tensorflow_inception_graph.pb. I'd like to get YOLO model in such format. For now, I don't care if it's YOLO-small, or YOLO (or tiny).

What do all these non-existing filenames mean?

# 1. Load yolo-tiny.weights
./flow --model cfg/yolo-tiny.cfg --load bin/yolo-tiny.weights

There isn't yolo-tiny.cfg anywhere.

What I've found on YOLO website is tiny-yolo-voc and yolo-voc.

When trying yolo-voc the model isn't loading:

Mac-mini-Olya:darkflow Olya$ ./flow --model cfg/yolo-voc.cfg --load bin/yolo-voc.weights
Parsing ./cfg/yolo-voc.cfg
Traceback (most recent call last):
  File "./flow", line 42, in <module>
    tfnet = TFNet(FLAGS)
  File "/Users/Olya/Documents/want_protobuf/darkflow/net/build.py", line 34, in __init__
    darknet = Darknet(FLAGS)
  File "/Users/Olya/Documents/want_protobuf/darkflow/dark/darknet.py", line 17, in __init__
    src_parsed = self.parse_cfg(self.src_cfg, FLAGS)
  File "/Users/Olya/Documents/want_protobuf/darkflow/dark/darknet.py", line 68, in parse_cfg
    for i, info in enumerate(cfg_layers):
  File "/Users/Olya/Documents/want_protobuf/darkflow/cfg/process.py", line 294, in cfg_yielder
    lx = layers[x]; xtype = lx['type']
TypeError: list indices must be integers, not unicode

When trying tiny-yolo-voc it's loading (./flow --model cfg/tiny-yolo-voc.cfg --load bin/tiny-yolo-voc.weights).
But the training doesn't work:
both
./flow --train --model cfg/tiny-yolo.cfg --load -1
and
./flow --model cfg/tiny-yolo.cfg --train --trainer adam
give an error AssertionError: Loss type [region] not implemented.

So, my questions are:

  1. Can .pb file with yolo-to-tensorflow model be received only after training process (because of ckpt files) or is there another way?
  2. Which .cfg file should be used for training?

Ideally, I'd like to see real 3 commands (load, train, save) with real filenames (urls), not some imaginary stuff. :)

Most helpful comment

Thanks a lot! really nice repository!

All 8 comments

Go to YOLO's website, download tiny-yolo-voc.weights and put it into ./bin/. Then run

./flow --model cfg/tiny-yolo-voc.cfg --load bin/tiny-yolo-voc.weights --savepb

Thank you for your special repository!
I use this repository to create .pb model in order to run on Android.
Finally I have got .pb model (thank you), but the model cannot be loaded on Android...
So I want to test .pb model on my desktop.

Is there any way to use .pb model saved by
./flow --model cfg/tiny-yolo-voc.cfg --load bin/tiny-yolo-voc.weights --savepb
command?

You can do that by uncommenting line 115 of ./net/build.py, by doing so, the .pb file will be used to test images in ./test/ and results are put in ./test/out

Thank you for your early reply!
You mean,

  1. uncommenting line 115 of ./net/build.py
  2. ./flow --model tiny-yolo.cfg --load graph-tiny-yolo.pb --savepb

It works well! I got the result in ./test/out
Really thank you!

I mean,

  1. Delete all previous predictions in ./test/out/
  2. Uncomment line 115 in ./net/build.py
  3. ./flow --model tiny-yolo.cfg --load tiny-yolo.weights --savepb
  4. Check ./test/out/

Sorry to keep bothering you.

I have 1 more question.
Is there anyway to check the inside of .pb model?
I want to check the name of each layers.
('input', 'output', something like this)

No problem :)
There are only two names: input for input image and output for output tensor.

Thanks a lot! really nice repository!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hrshovon picture hrshovon  路  5Comments

bareblackfoot picture bareblackfoot  路  4Comments

realityzero picture realityzero  路  3Comments

ManojPabani picture ManojPabani  路  4Comments

bareblackfoot picture bareblackfoot  路  5Comments