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

How to make ".pb" file #2

Closed
LittleWat opened this issue Dec 30, 2016 · 5 comments
Closed

How to make ".pb" file #2

LittleWat opened this issue Dec 30, 2016 · 5 comments

Comments

@LittleWat
Copy link

Hello!
Thank you for your nice implementation.

I would like to know how to make ".pb" file form output of darknet.
Did you use this ( https://github.com/thtrieu/darkflow ) ?

I am really glad if you help me!

@natanielruiz
Copy link
Owner

Thanks !

You can definitely use the model definitions from that repo. I used this repo: https://github.com/gliese581gg/YOLO_tensorflow

What I did is I saved the graph structure using tf.train.write_graph(), then I merged the graph with the pre-trained weights using the freeze_graph utility in the TensorFlow repo. Then I stripped the unused nodes and voila, you have a .pb graph with weights that you can use in the tensorflow android demo.

Cheers !

@LittleWat
Copy link
Author

Thank you!! I will try

@xieyulai
Copy link

xieyulai commented Jan 10, 2017

Great work, thank you. @natanielruiz

Could you provide more details? Now I am using darknet to training a detector (only one class needs to be detected). But in this step making '.bp' file ,I always get this kind of error
[[Node: save/RestoreV2_16/_1 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/gpu:0", send_device="/job:localhost/replica:0/task:0/cpu:0", send_device_incarnation=1, tensor_name="edge_75_save/RestoreV2_16", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"]()]]
I put tf.train.write_graph() in the last of build_networks() of YOLO_tiny_tf.py
and use python freeze_graph.py --input_graph=test_tiny.pb --input_checkpoint=model_tiny.ckpt --output_graph=out.pb to merge .bp and .ckpt

Thank you in advance.

@natanielruiz
Copy link
Owner

Hi Xieyulai,

I have never used darknet to train a network. I belive you are also talking about a protobuff ".pb" file.

I don't understand where in your code you get that error, that would be helpful to know.
Also I have never had that error before.

Cheers

@agjayant
Copy link

agjayant commented Jun 6, 2017

@natanielruiz Did you use the tiny-yolo version? If yes, how did you remove the Dropout Nodes(since they use ops that are not available in android - "realDiv" etc) ? Can you please share your code for removing unused nodes.

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

4 participants