Skip to content

Commit 892501d

Browse files
committed
TensorFlow fix as per abisee#64
1 parent 3b480d5 commit 892501d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

run_summarization.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ def main(unused_argv):
294294
# Make a namedtuple hps, containing the values of the hyperparameters that the model needs
295295
hparam_list = ['mode', 'lr', 'adagrad_init_acc', 'rand_unif_init_mag', 'trunc_norm_init_std', 'max_grad_norm', 'hidden_dim', 'emb_dim', 'batch_size', 'max_dec_steps', 'max_enc_steps', 'coverage', 'cov_loss_wt', 'pointer_gen']
296296
hps_dict = {}
297-
for key,val in FLAGS.__flags.items(): # for each flag
298-
if key in hparam_list: # if it's in the list
299-
hps_dict[key] = val # add it to the dict
297+
for key in hparam_list: # for each hyperparameter
298+
if hasattr(FLAGS, key): # if it was given on the command line
299+
hps_dict[key] = getattr(FLAGS, key) # add it to the dict
300300
hps = namedtuple("HParams", hps_dict.keys())(**hps_dict)
301301

302302
# Create a batcher object that will create minibatches of data

0 commit comments

Comments
 (0)