Can I use the tool freeze_graph.py
with models saved through saver.save
in TensorFlow v1? If so, how?
I have some code that looks something like this:
supervisor = tf.train.Supervisor(logdir=output_directory_path)
with supervisor.managed_session() as session:
supervisor.saver.save(session, output_directory_path)
This creates a directory containing:
checkpoint
output
output-16640.data-00000-of-00001
output-16640.index
output-16640.meta
Where output
is a directory containing files for intermediate stages of training. The rest of the files.
I understand that this is a meta-graph (file .meta
) and its variables (file .data*
) in saver v2 format. These files contain the data necessary for the tool freeze_graph.py
, but it is unclear how to tell the tool to freeze_graph.py
load data from these files.
All these attempts generate an error message. Input checkpoint '...' doesn't exist!
python freeze_graph.py --input_checkpoint checkpoint --output_graph /tmp/out
python freeze_graph.py --input_checkpoint . --output_graph /tmp/out
python freeze_graph.py --input_checkpoint output-16640 --output_graph /tmp/out
freeze_graph.py
'input_checkpoint' may be a prefix if we're using Saver V2 format
, --input_checkpoint
, , , , , .