I am trying to import a trained tensoflow neural network model. Initially the trained model is in checkpoint format (ckpt). I was able to convert the ckpt to savedModel (pb) format for use in importTensorFlowNetwork function. While running the function I obtain the following error:
net = importTensorFlowNetwork('EXP1_pb_model');
The python code I used to convert the ckpt to pb is as follow:
import tensorflow as tf
trained_checkpoint_prefix = '/exp_1/model.ckpt'
export_dir = os.path.join('model', 'EXP1_model')
graph = tf.Graph()
with tf.compat.v1.Session(graph=graph) as sess:
# Restore from checkpoint
loader = tf.compat.v1.train.import_meta_graph(trained_checkpoint_prefix + '.meta')
# Export checkpoint to SavedModel
builder = tf.compat.v1.saved_model.builder.SavedModelBuilder(export_dir)
Attached are the both the ckpt and pb models.
I would appericiate any help in resolving this issue.