I am trying to run a very simple saving of a Tensorflow graph as .pb file, but I have this error when parsing it back:
Traceback (most recent call last):
F
The problem here is that you are trying to parse a SavedModel protocol buffer as if it were a GraphDef. Although a SavedModel contains GraphDef, they have different binary formats. The following code, using tf.saved_model.loader.load() should work:
import tensorflow as tf
with tf.Session(graph=tf.Graph()) as sess:
tf.saved_model.loader.load(
sess, [tf.saved_model.tag_constants.SERVING], "models/TEST-3")