thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.13k stars 2.08k forks source link

How to get weight file from ckpt file #668

Open monupurohit opened 6 years ago

monupurohit commented 6 years ago

Thanks for the great article, i was able to create my own dataset. Question : How we can use the train model on other machine. (trained on windows and want to use the same on Linux machine- Raspberry pi)

I got the cfg file "tiny-yolo-voc-lift1c.cfg", "weight tiny-yolo-voc.weights" and load file :" 8625"

i copied the cfg,weights and only checkpoint 8625 files (not all check point files) to raspberry pi (linux bases machine) on Raspberry pi its not working for me. sudo ./darknet detect cfg/tiny-yolo-voc-lift1c.cfg 8625 lab2/000005.png

but pre-trained model are woring fine: sudo ./darknet detect cfg/tiny-yolo-voc.cfg bin/tiny-yolo-voc.weights lab2/dog.png

Could you please give the example for pb and meta part here.

sandeeprepakula commented 6 years ago

Did you copy all the below 4 files from a check point?

.profile .meta .data-00000-of-00001 .index

monupurohit commented 6 years ago

Thanks Sandeep for looking on my issue, to answer your question : Yes I copied all 4 files: tiny-yolo-voc-lift1c-8625.data-00000-of-00001 tiny-yolo-voc-lift1c-8625.index tiny-yolo-voc-lift1c-8625.meta tiny-yolo-voc-lift1c-8625.profile also copy the cfg and weight file.

I want to run this trained model on raspberry pi or any other linux machine.

sandeeprepakula commented 6 years ago

OK. In that case, do you have the files under darkflow/ckpt? or somewhere else?

monupurohit commented 6 years ago

yes, files are placed inside ckpt cfg file to cfg folder weight to bin folder

teamtoshare commented 6 years ago

Hi,

if I am not mistaken. Your command for creating a *.pb should be the following:

Saving the lastest checkpoint to protobuf (pb) file

flow --model cfg/tiny-yolo-voc-lift1c.cfg --load -1 --savepb

or in your case if it is the latest ckpt e.g. 8625

Saving a specific checkpoint to protobuf (pb) file

flow --model cfg/tiny-yolo-voc-lift1c.cfg --load 8625 --savepb

Does that work for you?

beebrain commented 6 years ago

@teamtoshare Thank you, but it doesn't work. Do you have any idea?

AbanoubMamdouh commented 5 years ago

Hello, I am highly interested in the answer of this question, anybody got any answers?

aimxu commented 4 years ago

Hello, I am highly interested in the answer of this question, anybody got any answers?

@AbanoubMamdouh Hi bro, did you fixed it? I have the same problem, expect for you rely