The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

AttributeError: module ‘tensorflow’ has no attribute ‘placeholder’

AttributeError: module ‘tensorflow’ has no attribute ‘placeholder’

0
Votes
1
Answer

How to resolve this issue in the current version of TensorFlow
print(tf.__version__) =

2.1.0

 

1 Answer

365 Team
0
Votes

Hi Jignesh,
Tensorflow 2 introduced the concept of eager execution which makes the tf.placeholder method obsolete.
You’re getting this error because your have TF v.2 installed but the code is for TF v.1.
You are watching lectures of the “Deep Learning with TensorFlow” course which uses TF 1.
If you wish to follow that course, that’s fine, but make sure to have tensorflow 1.* installed in your conda environment.
Otherwise, if you wish to write in the newer TF v.2 you should follow the “Deep Learning with TensorFlow 2.0” lectures. 
Hope that helps and don’t hesitate to ask more questions as they arise!
Iskren

×
LAST CHANCE
Ready to Learn Data Science?
50% OFF