Solutions to two common kinds of Errors when install Tensorflow

R. Jin
1 min readApr 28, 2020

I am writing this story is providing a summary of solutions to common errors that I met to you all who may need it in some ways. Wish it would help you out.

My install:

Windows 10 x64
NVIDIA Driver 442.05
CUDA 10.2.126
Python 3.7.6
GeForce GTX 1080

1, Error of “ImportError: DLL load failed: The specified module could not be found.” (See screenshot below)

Had this issue with Tensorflow 2.1.0 (CPU version). Managed to fix it by downgrading to Tensorflow 2.0.0:

pip install tensorflow==2.0.0

2, Error of “AttributeError: module ‘tensorflow’ has no attribute ‘Session’”

TF1.x hello world:

import tensorflow as tf
msg = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(msg))

TF2.x hello world:

import tensorflow as tf
msg = tf.constant('Hello, TensorFlow!')
tf.print(msg)

For more info, see https://www.tensorflow.org/guide/effective_tf2

At last, your applause would be appreciated.

Stay well under Covid-19 pandemic.

--

--

R. Jin

世界が终わるまでは… #watchman@CSUF#R&D #VR/AR #ML #randomblogging #solutionsharing #opinionsonmyown