code: def export_compact(model_path):
      
      pred_config = PredictConfig(
          session_init=get_model_loader(model_path),
          model=Model(),
          input_names=['input_img'],
          output_names=['prediction_img'])
      ModelExporter(pred_config).export_compact('/tmp/compact_graph.pb')
docs: Export trained model to use it as a frozen and pruned inference graph in
         mobile applications.