Fresh install tensorflow - tensorflow

I installed tensorflow using pip earlier (CPU only version). It was showing me some warnings whenever I used to work with it. Now I tried to install the GPU version. Now when I import tensorflow, it gives a bunch of errors.
So I wanted to know if there was a way to completely delete tensorflow from Ubuntu and then reinstall it later?

pip packages can be uninstalled pip uninstall tensorflow. Make sure you are uninstalling it from the environment of concern (if applicable).The pip output will inform you of it's successful removal. This should be enough to remove tensorflow from your system. You can then pip install tensorflow --ignore-installed to reinstall. The --ignore-install flag should overwrite tensorflow if you're concerned it was not successfully removed.
Please note that if you tried to install tensorflow GPU version that you will need to uninstall using tensorflow-gpu isntead of tensorflow. Same for re-installing.
Regarding your other issues, I suggest you open a fresh question for your errors. There's a good chance you weren't receiving errors but just the standard info messages from Tensorflow-GPU.

Related

Install tensorflow 1.x on colab

Now that Google Colab is not supporting tensorflow 1.x is there a way to install it through e.g. pip and set up your environment in a similar fashion to what the old %tensorflow_version 1.x did? I really really dont want to rewamp all my code to TF 2
It seems that only tf2 is supported by Colab, but that's not true, you still can use pip to uninstall tf2 and install a specific version of tf1. !yes|pip uninstall tensorflow, !pip install tensorflow==1.15.5 Maybe you should install other dependencies. So use !pip install -r requirements.txt Attention! You must restart the runtime in order to use newly installed versions.

Can't install TensorFlow via pip3

I am currently trying to set up TensorFlow on Ubuntu via EC2, however I was having an issue where when I whenever I upgraded pip3 and tried to install TensorFlow, I would get a 'killed' at the end of the download.
I am not entirely sure what I am doing wrong but based on some googling, some thoughts were possibly a pathing issue?
Photo of killed error(?)
You are probably running low on memory :
pip3 install tensorflow --no-cache-dir

How to install Keras with gpu support?

I installed Tensorflow for GPU using: pip install tensorflow-gpu
But when I tried the same for Keras pip install keras-gpu, it pulled me an error: could not find the version that satisfies the requirements.
Adding to the answer below which is the correct answer in terms of recommending to use Anaconda package manager, but out of date in that there is now a keras-gpu package on Anaconda Cloud.
So once you have Anaconda installed, you simply need to create a new environment where you want to install keras-gpu and execute the command:
conda install -c anaconda keras-gpu
This will install Keras along with both tensorflow and tensorflow-gpu libraries as the backend. (There is also no need to install separately the CUDA runtime and cudnn libraries as they are also included in the package - tested on Windows 10 and working).
There is not any keras-gpu package [UPDATE: now there is, see other answer above]; Keras is a wrapper around some backends, including Tensorflow, and these backends may come in different versions, such as tensorflow and tensorflow-gpu. But this does not hold for Keras itself, which should be installed simply with
pip install keras
independently of whatever backend is used (see the PyPi docs).
Additionally, and since you have tagged the question as anaconda, too, be informed that it is generally not advisable to mix your package managers (i.e pip with conda), and you may be better off installing Keras from the Anaconda cloud with
conda install -c conda-forge keras
Finally, you may be also interested to know that recent versions of Tensorflow include Keras as a subpackage, so you can use it without any additional installation; see https://www.tensorflow.org/guide/keras
For installing tensorflow-gpu from Anaconda cloud, you should use
conda install -c anaconda tensorflow-gpu
before installing Keras. Be sure you do it in a different virtual environment, or after having uninstalled other versions (i.e. pip-installed ones), as there have been reported problems otherwise.
Adding to the above two answers, ensure your TensorFlow/Keras environment is using Python 3.6. Keras/TensorFlow doesn't work very well with Python 3.7, as of May 10, 2019.
I tried to use Keras/TensorFlow with Python 3.7 and I ended up having to reinstall Anaconda, since it sort of broke my Anaconda Prompt.
To install tensorflow-gpu with particular cuda version 9.0, use:
conda install tensorflow-gpu cudatoolkit==9.0 -c anaconda
Similarly for keras-gpu

Has something changed recently with tensorflow installation process?

Trying to install tensorflow on mac.
Just created a virtual environment, with python 2.7.10. then i did
"pip install tensorflow"
I get
"No matching distribution found for tensorflow"
Did this so many times in past. Even tried pip3
Same results. I dont want tensorflow-GPU
Problem is that grpcio== 1.10.0 is broken.
Check this thread on github
Solution:
Try:
pip install grpcio==1.9.1 tensorflow
If this does not work then try
pip install grpcio==1.9.1 https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.6.0-py2-none-any.whl
For me second step worked. Hope this helps

What is the difference in installing tensorflow with pip command and conda or directing cloning?

For the first time I'v installed tensorflow with conda installation. Then I actually work with a seq2seq model. After that I have again installed the tensorflow with the pip installation. But now the libraries are very different. All the old scripts are misplaced etc. Why is that ? Why I didn't face this when I was working with coda instillation
It has been claimed that Tensorflow installed with Conda performs a lot faster than a Pip installation, for example:
https://towardsdatascience.com/stop-installing-tensorflow-using-pip-for-performance-sake-5854f9d9eb0c
Conda also installs all of the package dependencies automatically, which Pip does not, as far as I'm aware.
https://www.anaconda.com/blog/developer-blog/tensorflow-in-anaconda/
Pip and conda install to two different locations. You should try to stick to one or the other. I would recommend uninstalling the conda version and sticking to pip but it's up to you how to proceed.
Update 01-02-2019: It seems that conda is now the faster and preferred way to install tensorflow. Note this may change again in the future.