diff --git a/modules/deeplearning/icing_fcn.py b/modules/deeplearning/icing_fcn.py index 1d561907018ea95e3d4e88928dd9a8a305b50175..0feb07194f96086f20911a392235621d9fb4c3c4 100644 --- a/modules/deeplearning/icing_fcn.py +++ b/modules/deeplearning/icing_fcn.py @@ -1190,13 +1190,16 @@ def run_average_models(ckpt_dir_s_path, day_night='NIGHT', l1b_andor_l2='BOTH', model_weight_s.append(k_model.get_weights()) print('done loading models ******************************************') + num_model_lyrs = len(model_weight_s[0]) + model_lyrs = [[] for k in range(num_model_lyrs)] + avg_model_weights = [] for m in model_weight_s: - print(len(m)) - for w in m: - print(w.shape) - # avg_model_weights.append(np.mean(w)) - print('--------------------------------------') + for k, w in enumerate(m): + model_lyrs[k].append(w) + for lyr in model_lyrs: + nda = np.stack(lyr) + avg_model_weights.append(nda) # -- Make a new model for the averaged weights new_model = IcingIntensityFCN(day_night=day_night, l1b_or_l2=l1b_andor_l2, use_flight_altitude=use_flight_altitude)