9

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

Shamane Siriwardhana
  • 3,951
  • 6
  • 33
  • 73

2 Answers2

10

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/

Pog Le Pog
  • 171
  • 2
  • 8
  • It certainly wasn't true for me on Windows. Same speed for both, and no AVX2 support. – Roman Starkov Jan 26 '19 at 01:09
  • 1
    I tested the conda installation versus pip installation for multi layer perceptrons trained on CPU and did not see a performance speed up. – giminey Aug 18 '19 at 19:57
  • We run LSTMs for timeseries predictions and the conda install was extremely perceptibly slower than pip. About 2x slower. No idea under what specific circumstances conda would be faster, but this is not true for our use case. – CodingInCircles Jun 21 '20 at 02:22
  • Installing packages automatically is the main benefit. There are different builds for GPU, MKL, etc within the `tensorflow` package that you can select during installation that would affect the speed. – endolith Apr 09 '22 at 16:50
2

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.

Steven
  • 5,134
  • 2
  • 27
  • 38
  • but in the pip version lot of packages are mis-placed. Specially old things. So it makes really difficult to use some open source code projects. – Shamane Siriwardhana Mar 10 '17 at 02:59
  • I'm not sure what you mean by misplaced? The API has changed with the latest version that your installing from pip. – Steven Mar 10 '17 at 03:02
  • #from tensorflow.models.rnn.translate import data_utils I cannot import the above library. They have changed the api. So even I downloaded from the conda it will be the same api or a different ? – Shamane Siriwardhana Mar 10 '17 at 03:05
  • 1
    conda tends to be updated later now if at all. Not sure if that will change. Here's an official note from Tensorflow "NOTE: The conda package is community supported, not officially supported. That is, the TensorFlow team neither tests nor maintains the conda package. Use that package at your own risk." you need to download this model separately now I believe. https://github.com/tensorflow/models – Steven Mar 10 '17 at 03:16
  • "*Pip and conda install to two different locations*" - that's just not true. – merv Jun 09 '22 at 17:33
  • @merv that's actually always been true. You can force them to install to the same location but it will probably lead to errors. See here for where conda possibly installs to: https://stackoverflow.com/questions/31003994/anaconda-site-packages – Steven Jun 10 '22 at 20:31
  • If you `pip install` a package *with the environment activated* it will get installed in the `site-packages` associated with that Python, which is the `site-packages` that Conda uses when installing Python packages. Maybe you are thinking of the user site? i.e., what happens when using `pip install --user`? And yes, it is known that Conda and Pip clobber each other's packages. – merv Jun 10 '22 at 20:48