jinyu121 / DW2TF

Darknet Weights to TensorFlow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Converted tiny_yolov3 but the .pb file is about 96.5kb

Zeeshan75 opened this issue · comments

I have trained a yolov3_tiny model based on alexeyAB repository then I used those weights to convert into a .pb file using this repository but I got the .pb file with 96.5kb and checkpoints with 33.7mb

you can save the ckpt to the pb by tensorflow in few lines.

@Zeeshan75 Did you solve this problem?

No, I am not able to solve this. It would be much helpful if anyone can help with this issue.

@Zeeshan75 What you have is an unfrozen .pb and weights as .ckpt. I imagine what you're looking for is a frozen .pb containing the weights. Check out this doc to freeze a graph.

you can save the ckpt to the pb by tensorflow in few lines.

I tried but its generating error that it cant convert to .pb, Here the issue is I have both .pb and .ckpt file generated from this repo using weights file. But, the generated .ckpt file is around 33mb and .pb file with 95kb.

@Zeeshan75 What you have is an unfrozen .pb and weights as .ckpt. I imagine what you're looking for is a frozen .pb containing the weights. Check out this doc to freeze a graph.

It will be much helpful if you can give much more information regarding this as codes to use it.

@Zeeshan75
Finally, how do you solve it? I also encountered this problem.

Just to clarify, this is not a problem. The graph (.pb) that DW2TF generates only contains the operations and connectivity. It doesn't (and should not) embed the weights within it, which are saved out in the checkpoint files. The size you see is expected.

On the other hand, I've noticed the darkflow graphs embed the weights (frozen) within the graph (.pb), while generating separate checkpoints. This is unnecessary and consumes twice the memory to save the network.

@Zeeshan75 You can find example code to load the (unfrozen) graph and weights from ckpt using saver.restore; see the 3rd cell in this notebook.