问题
I want to use AdamOptimizer with GPFlow, however I cannot import it as suggested as the source code in this link (line 26) specifies. I am unsure what I am missing. I have tried with different gpflow versions (1.1.1 and 1.3).
Thanks
回答1:
I guess it happens because you are using TF >=1.14. The released GPflow packages <= 1.4.1 support TF <=1.13.1 only. The GPflow develop
branch now does support TF 1.14, but this has not yet been released.
There is an unofficial (in progress) GPflow2 with TF 2.0 support, if you are interested.
回答2:
This issue is now fixed in GPflow develop. See https://github.com/GPflow/GPflow/pull/997.
回答3:
Copy the fixes from this pull request (link) into your GPflow-1.4.1/gpflow/training/tensorflow_optimizer.py
file and reinstall GPFlow.
来源:https://stackoverflow.com/questions/56741160/importerror-cannot-import-name-adamoptimizer-in-gpflow