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

AttributeError: module 'tensorflow' has no attribute 'placeholder' #27

Open
mdwhitis opened this issue May 23, 2020 · 0 comments
Open

Comments

@mdwhitis
Copy link

mdwhitis commented May 23, 2020

You will get this error if using TensorFlow 2.x:

Traceback (most recent call last):
File "C:\Users\y\AppData\Local\Programs\Python\Python37\music-generator-1\rbm_chords.py", line 59, in
x = tf.placeholder(tf.float32, [None, n_visible], name="x")
AttributeError: module 'tensorflow' has no attribute 'placeholder'

I fixed it by changing: rbm_chords.py:

#import tensorflow as tf

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

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