Export trained model to use it as a frozen and pruned inference graph in mobile applications.
(model_path)
| 113 | |
| 114 | |
| 115 | def export_compact(model_path): |
| 116 | """Export trained model to use it as a frozen and pruned inference graph in |
| 117 | mobile applications. """ |
| 118 | pred_config = PredictConfig( |
| 119 | session_init=SmartInit(model_path), |
| 120 | model=Model(), |
| 121 | input_names=['input_img'], |
| 122 | output_names=['prediction_img']) |
| 123 | ModelExporter(pred_config).export_compact('/tmp/compact_graph.pb') |
| 124 | |
| 125 | |
| 126 | def apply(model_path): |
no test coverage detected