Issue Installing Tensorflow -- Not A Cuda/cudnn Issue
Solution 1:
@user1735003 figured it out. I unistalled the latest version of tensorflow
pip uninstall tensorflow
and then installed tensorflow 1.5
pip install tensorflow==1.5
then I verified the installation worked with the script
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
I got the correct output
Hello, TensorFlow!
Solution 2:
My guess is that you are trying to use TF >= 1.6, because your CPU is rather old and does not support AVX instructions. Indeed from 1.6 on, tensorflow pre-built binaries use AVX instructions.
Currently your options are either to:
- Use an official pre-built binary of TF 1.5 or earlier. (You will miss a few things but it's still OK I would say).
- Search for an unofficial pre-built binary of TF >= 1.6 that does not support AVX.
- Currently, pre-built binaries until TF 1.10 from
conda install
on Windows seem not to be built with AVX support, although I could not find this information anywhere and therefore cannot tell if this is intentional and how long that will be the case. - Beware that binaries from
conda-forge
(which used to be the main conda tensorflow provider before it has been available on the main channel) on the other hand are built with AVX support.
- Currently, pre-built binaries until TF 1.10 from
- Change your hardware to support AVX (obviously).
- Compile your own binary of tensorflow without AVX instructions. A reasonable option if none of the others were possible.
Solution 3:
Have in mind that the above answers are correct for a lot of cases. However, downgrading to tensorflow 1.5 might not be the best solution because for instance, you won't have access to some of the new features of tensorflow like the 'eager execution' feature for example.
What i did in my case was to install tensorflow 1.8 with conda instead of pip. From my little experience with conda and pip, conda seems to perform better when it comes to placing required files in their proper location.
In summary,
Instead of pip3 install --upgrade tensorflow
,
i used conda install tensorflow
which will install the latest version properly.
In case you don't have Anaconda installed for conda
commands. Download from here
Solution 4:
If the problem persists check the version numbering and make sure cuda and TF are compatible.
Check the version numbering here
or for a simpler way, use Anaconda
conda create --name new_env_name tensorflow-gpu
activate new_env_name
I successfully installed TensorFlow GPU version 1.12 (latest until the date of writing) with Cuda 9.0, GeForce 1050 Ti, Windows 10 and Python 3.6.7
Note: You have installed the CUDA Toolkit (version 9) for TensorFlow to recognize your GPU
Post a Comment for "Issue Installing Tensorflow -- Not A Cuda/cudnn Issue"