I changed from tf.train.Saver
to the SavedModel format which surprisingly means loading my model from disk is a lot slower (instead of a couple of seconds it takes
I am by no ways an expert in Tensorflow, but if I had to take a guess as to why this is happening, I would say that:
Depending on the size of your graph, recreating everything that it contained might take some time.
Concerning the second question, as @J H said, if there are no reasons for you to use one strategy over the other, and time is of the essence, then just go with the fastest one.
what can I do to load the model faster?
Switch back to tf.train.Saver
, as your question shows no motivations for using SavedModelBuilder, and makes it clear that elapsed time matters to you. Alternatively, an MCVE that reproduced the timing issue would allow others to collaborate with you on profiling, diagnosing, and fixing any perceived performance issue.