From b26876c542c45e8a3f8b3f047e9c056b6280d8f7 Mon Sep 17 00:00:00 2001 From: detlef Date: Sun, 25 Aug 2019 19:11:55 +0200 Subject: [PATCH] - removed bias layer hast to be at position17 for debugging outputs --- few_shot_tests.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/few_shot_tests.py b/few_shot_tests.py index 38597e4..fcbada0 100755 --- a/few_shot_tests.py +++ b/few_shot_tests.py @@ -446,7 +446,7 @@ def all_layers(model): #print('test lambda', K.eval(test_lambda)) -print('vor fitting', lambda_model_layers[17].get_weights()[0]) +#print('vor fitting', lambda_model_layers[17].get_weights()[0]) checkpointer = ModelCheckpoint(filepath='checkpoints/model-{epoch:02d}.hdf5', verbose=1) tensorboard = TensorBoard(log_dir = args.tensorboard_logdir) @@ -494,12 +494,19 @@ def print_FindModels(model): print('calc_out',calc_out[0]) -print('vor', lambda_model_layers[17].get_weights()[0]) +for l in lambda_model_layers: + if isinstance(l,BiasLayer) and l.bias_num == 2: + print('vor', l.get_weights()[0]) if args.set_model_img_to_weights: print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') - lambda_model_layers[17].set_weights([calc_out[0][0],np.array([0])]) - print('nach', lambda_model_layers[17].get_weights()[0]) + for l in lambda_model_layers: + if isinstance(l,BiasLayer) and l.bias_num == 2: + print("biaslayer2 found",l,l.bias_num) + l.set_weights([calc_out[0][0],np.array([0])]) + print('nach l', l.get_weights()[0]) + #print('nach [17]', lambda_model_layers[17].get_weights()[0]) + print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')