Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
flycsuu opened this issue Sep 20, 2018 · 0 comments

Comments

@flycsuu
Copy link

flycsuu commented Sep 20, 2018

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,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant