Skip to content

Instantly share code, notes, and snippets.

View zhujilin1995's full-sized avatar

Kirin Ju zhujilin1995

  • 18:35 (UTC +08:00)
View GitHub Profile
@moodoki
moodoki / exportgraph.py
Last active February 14, 2023 05:58
Freeze and export Tensorflow graph from checkpoint files
import os, argparse
import tensorflow as tf
from tensorflow.python.framework import graph_util
dir = os.path.dirname(os.path.realpath(__file__))
def freeze_graph(model_folder, output_nodes='y_hat',
output_filename='frozen-graph.pb',
rename_outputs=None):