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

14.3 Icon GAN--AttributeError: module 'tensorflow_core._api.v2.train' has no attribute 'AdamOptimizer' #78

Open
mikechen66 opened this issue May 9, 2020 · 0 comments

Comments

@mikechen66
Copy link

Hi Douwe:

While running the script on TensorFlow 2.0 and Keras 2.3.1, it shows the AttributeError. After changing the adam method from tf.train.AdamOptimizer() to tf.optimizers.Adam(), it shows the TensorFlow methods including compute_gradient(), get_session() method need to be changed accordingly. It is a chained response and hard to be fixed. I think that the solution depends on you.

AttributeError

generating GAN...


AttributeError Traceback (most recent call last)
in
65
66 print('generating GAN...')
---> 67 gan_feed = gan(generator, discriminator)

in gan(g, d)
19 gloss = - K.mean(log_eps(gscore))
20
---> 21 Adam = tf.train.AdamOptimizer
22
23 lr, b1 = 1e-4, .2 # otherwise won't converge.

AttributeError: module 'tensorflow_core._api.v2.train' has no attribute 'AdamOptimizer'

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