MCPcopy Create free account
hub / github.com/commaai/research / load

Function load

models/utils.py:215–230  ·  view source on GitHub ↗

Load tensorflow model checkpoint

(sess, saver, checkpoint_dir, name)

Source from the content-addressed store, hash-verified

213
214
215def load(sess, saver, checkpoint_dir, name):
216 """Load tensorflow model checkpoint"""
217 print(" [*] Reading checkpoints: {}".format(checkpoint_dir))
218
219 model_dir = name
220 checkpoint_dir = os.path.join(checkpoint_dir, model_dir)
221
222 ckpt = tf.train.get_checkpoint_state(checkpoint_dir)
223 if ckpt and ckpt.model_checkpoint_path:
224 ckpt_name = os.path.basename(ckpt.model_checkpoint_path)
225 saver.restore(sess, os.path.join(checkpoint_dir, ckpt_name))
226 print(" [*] Checkpoints read: {}".format(ckpt_name))
227 return True
228 else:
229 print(" [!] Failed reading.")
230 return False

Callers 3

f_loadFunction · 0.90
f_loadFunction · 0.90
f_loadFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected