Tensorflow is one of the most used software libraries for machine learning. It is developed by Google and can be used with Python. Current version is 1.9.
Do I have Tensorflow?
To find out wether you have Tensorflow installed and which version you might have, type
python3 -c 'import tensorflow as tf; print(tf.__version__)'
If that throws an error saying somethin with
invalid syntax, please check for your Python version and downgrade.
On a Mac with pip
Pip is a Python package manager that let’s you install Tensorflow and other software. You will need pip3 with version >10. Please check your version with:
Current version is 18, so you might (or will have to) upgrade. Please try one of those:
$ pip3 install --upgrade
$ sudo pip3 install --upgrade
Then check if installation was successfull by checking vor the version again (see above). Then try installing Tensorflow again.
Now install Tensorflow:
$ pip3 install tensorflow
If that seemed to be successful, confirm the installation by checking for the version (see above). If not, continue with step 2 from this installation guide.
Error "Could not find ..."
This error seems to be quite common. Then try
$ sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.9.0-py3-none-any.whl
This command can also be used to upgrad your version of Tensorflow.
Check for the version again to assure, that Python and Tensorflow are working nice together.
Other ways of installing
Here you find the official install guides for various platforms.
Some official Tensorflow tutorials to get started with.
Archive of tested Tensorflow models on GitHub.
Try these commands
$ pip uninstall tensorflow $ pip3 uninstall tensorflow