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

word2vec_tensorfow; AttributeError: module 'tensorflow' has no attribute 'placeholder' #2

Open
ziwenyd opened this issue Aug 31, 2020 · 0 comments

Comments

@ziwenyd
Copy link

ziwenyd commented Aug 31, 2020

versions: I am using tensorflow 2; python3

Thank you for the helpful tutorial! I am trying your tutorial code for word2vec but seems there is a version issue.

I searched and found out that seems placeholder is no longer supported in TensorFlow v2, could you please update the tutorial code or share a hint on how to fix it? Thanks!

Error is found at:
word2vec_tensorflow -> Defien Tensorflow Graph
`import tensorflow as tf

making placeholders for X_train and Y_train

x = tf.placeholder(tf.float32, shape=(None, ONE_HOT_DIM))
y_label = tf.placeholder(tf.float32, shape=(None, ONE_HOT_DIM))`

Error message:
`---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in
1 import tensorflow as tf
2 # making placeholders for X_train and Y_train
----> 3 x = tf.placeholder(tf.float32, shape=(None, ONE_HOT_DIM))
4 y_label = tf.placeholder(tf.float32, shape=(None, ONE_HOT_DIM))

AttributeError: module 'tensorflow' has no attribute 'placeholder'`

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