test/TensorFlowNET.Examples/ImageProcessing/RetrainImageClassifier.cs
/// <summary>
/// Saves an graph to file, creating a valid quantized one if necessary.
/// </summary>
/// <param name="graph_file_name"></param>
/// <param name="class_count"></param>
Saves an graph to file, creating a valid quantized one if necessary.
Saves an graph to file creating a valid quantized one if necessary .
private void save_graph_to_file(string graph_file_name, int class_count)
        {
            var (sess, _, _, _, _, _) = build_eval_session(class_count);
            var graph = sess.graph;
            var output_graph_def = tf.graph_util.convert_variables_to_constants(
                sess, graph.as_graph_def(), new string[] { final_tensor_name });
            File.WriteAllBytes(graph_file_name, output_graph_def.ToByteArray());
        }
private void save_graph_to_file ( string graph_file_name , int class_count ) { var ( sess , _ , _ , _ , _ , _ ) = build_eval_session ( class_count ) ; var graph = sess . graph ; var output_graph_def = tf . graph_util . convert_variables_to_constants ( sess , graph . as_graph_def ( ) , new string [ ] { final_tensor_name } ) ; File . WriteAllBytes ( graph_file_name , output_graph_def . ToByteArray ( ) ) ; }
Saves an graph to file, creating a valid quantized one if necessary.
Saves an graph to file creating a valid quantized one if necessary .
graph_file_name
string
None
class_count
int
None