MCPcopy
hub / github.com/MrNothing/AI-Blocks / InitModel

Method InitModel

Sources/build_scripts/global_functions.py:501–515  ·  view source on GitHub ↗
(load_path="")

Source from the content-addressed store, hash-verified

499
500class AIBlocks:
501 def InitModel(load_path=""):
502 # Initializing the variables
503 init = tf.global_variables_initializer()
504
505 # 'Saver' op to save and restore all the variables
506 saver = tf.train.Saver()
507
508 sess = tf.Session()
509 sess.run(init)
510
511 if len(load_path)>0 and os.path.exists(load_path+"/model.meta"):
512 res=saver.restore(sess, load_path+"/model")
513 Log ("Model loaded from: "+load_path+"/model")
514
515 return TFInstance(sess, saver, load_path)
516
517 def SaveModel(instance, save_path=""):
518 if len(instance.save_path)>0:

Callers 6

RunFunction · 0.80
RunFunction · 0.80
RunFunction · 0.80
RunFunction · 0.80
RunFunction · 0.80
RunFunction · 0.80

Calls 2

LogFunction · 0.85
TFInstanceClass · 0.85

Tested by 1

RunFunction · 0.64