oandrienko / fast-semantic-segmentation

ICNet and PSPNet-50 in Tensorflow for real-time semantic segmentation
220 stars 41 forks source link

model compression #9

Closed Ariel-JUAN closed 5 years ago

Ariel-JUAN commented 5 years ago

Nice work! The Pruning Filters for Efficient ConvNets that you implemented seems very difficult, it includes a lot of funtions..... I felt sad....... https://github.com/oandrienko/fast-semantic-segmentation/blob/8f7315f1adf9aa999c7c0ae712d18c6b51abd35e/libs/filter_pruner.py#L116 I use meta of checkpoint to import graph, and not use pb file. So how should I change this line? I know you try to get the input of the output code, but if I use checkpoint file, it seems the tensor has no input function.......

oandrienko commented 5 years ago

@Ariel-JUAN Thanks for your interest in the project and for posting the issue.

Previous to your comment, the compression script loaded a GraphDef from either a pb or pbtxt file as you specified. I used it as an alternative to the .meta file that composes a Tensorflow checkpoint. This was definitely unnecessary as you suggest so I have updated the compression script to now use the MetaGraph file to load a GraphDef. This is implemented as of commit 5d78371. Let me know if this works for you and if you run into any issues.

Thanks for the suggestion!

Ariel-JUAN commented 5 years ago

Thanks for replying! It worked! If I want to compress my own model, how should I change the configs/compression/icnet_resnet_v1_pruner_v2.config? It looks like I need to write a config for my own model. My model is also resnet50, but it is implemented in this way: link I wonder how can I get a config like yours? Thank you!