Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: module 'tensorflow' has no attribute 'Session'

When I call any function in python3.6, I get the error below; however, it works fine in python3.4. Any idea? import tensorflow as tf tf.Session() Traceback (most recent call last): File "", line 1, in AttributeError: module 'tensorflow' has no attribute 'Session'

Here is my System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Debian 8.7
  • TensorFlow installed from (source or binary): by pip3
  • TensorFlow version (use command below): 1.7.0
  • Python version: 3.6.5
  • CUDA/cuDNN version: cuda 9.0 and cudnn 7.0
  • GPU model and memory: K80, 12 GB
  • Exact command to reproduce: import tensorflow as tf tf.Session()
like image 903
Afshin Oroojlooy Avatar asked Nov 29 '25 04:11

Afshin Oroojlooy


1 Answers

I meet the problem too. Reinstall TensorFlow solve my ploblem.

  pip uninstall tensorflow-gpu
  pip install tensorflow-gpu
like image 79
Xiao-tianyu Avatar answered Nov 30 '25 22:11

Xiao-tianyu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!