I tried to use this example of using the Tensorflow-preserving model in C ++ on this website:
https://medium.com/jim-fleming/loading-a-tensorflow-graph-with-the-c-api-4caaff88463f# .ji310n4zo
It works well. But it does not save the values โโof the variables a and b , since it saves the graph not variables. I tried replacing the following line:
tf.train.write_graph(sess.graph_def, 'models/', 'graph.pb', as_text=False)
from
saver.save(sess, 'models/graph', global_step=0)
of course, after creating the guardian object. It does not work and outputs:
Not Found: FeedInputs: Cannot Find Feed Out
I checked the Nodes for Downloadable Nodes, and they only:
_SOURCE
_SINK
and in the write_graph function, and then load the model in C ++, I loaded the following nodes:
_SOURCE
_SINK
save / restore_slice_1 / shape_and_slice
/restore_slice_1/tensor_name
/restore_slice/shape_and_slice
/restore_slice/tensor_name
//shapes_and_slices
//tensor_names
/Const
/restore_slice_1
/restore_slice
/Assign_1
/
/initial_value
/
/
/restore_all
/
/control_dependency
/
/initial_value
/
INIT
, saver.save(), , 165B, , write_graph, 1.9KB.