4

I have done customized training using Darkflow and yolov2.weights. There are four files in checkpoint folder.These are:

1.yolov2-3c-5500.data-00000-of-00001
2.yolov2-3c-5500.index
3.yolov2-3c-5500.meta
4.yolov2-3c-5500.profile

I want to convert these file .weights?

Currently the checkpoint are loaded like this:

options = {
    'model': 'cfg/yolov2-4c.cfg',
    'load': 5500,
    'threshold': 0.3,
    'gpu':1.0

}

I want to load 'load' key as .weights file.

Mateen Ulhaq
  • 24,552
  • 19
  • 101
  • 135
mujahir
  • 187
  • 4
  • 11

1 Answers1

2

The trained checkpoint files yolov2-3c-5500.data file is actually your weight file. If you want to convert to .pb file, use the below command

flow --model cfg/Your_ConfigFile.cfg --load ckpt/Your_required_checkpoint-chkptNumber --savepb

Ex: flow --model cfg/Your_ConfigFile.cfg --load 5500 --savepb

Surya Tej
  • 1,342
  • 2
  • 15
  • 25
  • if you look at your ckpt folder, inside you will find the data, meta , profile files, so for your case probably `flow --model cfgyolov2-3c.cfg --load ckpt/yolov2-3c-5500 --savepb` – Surya Tej Jun 08 '18 at 15:12
  • One more question after converting into .pb format will I be able to load weights in the following way: load =bin/yolov2-3c-5500.pb? – mujahir Jun 08 '18 at 15:20
  • @sultan, to test your pb files for object detection, use this command `flow --pbLoad built_graph/yolo.pb --metaLoad built_graph/yolo.meta --imgdir sample_img/` Paste your images in the sample_img directory – Surya Tej Jun 11 '18 at 05:33
  • Thanks for your answer,But I wanted to know is there any way to convert this into a single file.Here I can see that two files i s being used '.pb' and '.meta'.I wan to test this on real time video. – mujahir Jun 11 '18 at 18:14
  • pb files have your weights information, you can use these to perform your object detection on video feed. meta file is just a json representation of it. Use openCv video capture to read in the frames data, for each frame, use `TFNet` `return_predict(frame)` method to see your results – Surya Tej Jun 12 '18 at 10:01
  • When running this command,python flow --model cfg/yolov2-3c.cfg --load ckpt/yolov2-3c-5500 --savepb, I am getting this error :AssertionError: ckpt/yolov2-3c-5500 not found – mujahir Jun 19 '18 at 06:09
  • I got solution,the error was in loading the ckpt folder,the correct command will be 'python flow --model cfg/yolov2-3c.cfg --load 5500 --savepb' – mujahir Jun 19 '18 at 06:23