Skip to content
Snippets Groups Projects
Commit cbf3c432 authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 9d483005
No related branches found
No related tags found
No related merge requests found
......@@ -1188,6 +1188,7 @@ def run_average_models(ckpt_dir_s_path, day_night='NIGHT', l1b_andor_l2='BOTH',
model = load_model(ckpt_dir, day_night=day_night, l1b_andor_l2=l1b_andor_l2, use_flight_altitude=use_flight_altitude)
k_model = model.model
model_weight_s.append(k_model.get_weights())
print('done loading models ******************************************')
avg_model_weights = []
for m in model_weight_s:
......@@ -1204,13 +1205,13 @@ def run_average_models(ckpt_dir_s_path, day_night='NIGHT', l1b_andor_l2='BOTH',
new_model.build_evaluation()
# -- Save the averaged weights to a new the model
if not os.path.exists(modeldir):
os.mkdir(modeldir)
ckpt = tf.train.Checkpoint(step=tf.Variable(1), model=new_model.model)
ckpt_manager = tf.train.CheckpointManager(ckpt, modeldir, max_to_keep=3)
new_model.model.set_weights(avg_weights)
ckpt_manager.save()
# if not os.path.exists(modeldir):
# os.mkdir(modeldir)
# ckpt = tf.train.Checkpoint(step=tf.Variable(1), model=new_model.model)
# ckpt_manager = tf.train.CheckpointManager(ckpt, modeldir, max_to_keep=3)
#
# new_model.model.set_weights(avg_weights)
# ckpt_manager.save()
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment