conv_seq2seq icon indicating copy to clipboard operation
conv_seq2seq copied to clipboard

Solutions of TypeError: <lambda>() got an unexpected keyword argument 'momentum'

Open flycsuu opened this issue 6 years ago • 0 comments

I think this is due to the version of TF, my version is r1.9 and r1.11 Two ways to solve this problem: Method One: 1.Emacs conv_seq2seq/example_configs/conv_seq2seq.yml 2.Remove from line 15 to 17

# optimizer.params:
#     momentum: 0.99
#     use_nesterov: True  

3.Emacs conv_seq2seq/seq2seq/models/conv_seq2seq.py 4.Remove in line 72 #"optimizer.params": {"momentum": 0.99, "use_nesterov": True}, # Arbitrary parameters for the optimizer Method Two(Not recommended): 1.Emacs ~/tensorflow/contrib/layers/python/layers/optimizers.py 2.Modify the code in line 44

        # "Momentum": lambda learning_rate: train.MomentumOptimizer(learning_rate, momentum=0.9),  # pylint: disable=line-too-long
        "Momentum": train.MomentumOptimizer,

flycsuu avatar Sep 20 '18 13:09 flycsuu