Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install CPU version of tensorflow using conda

If I run conda install tensorflow conda wants to install the GPU version, together with CUDA etc. I do not have an Nvidia GPU so I want to install the CPU-only version.

$ conda install tensorflow
Solving environment: done

## Package Plan ##

  environment location: /home/cjk/.conda/envs/athion-forecaster

  added / updated specs: 
    - tensorflow


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    tensorflow-base-1.12.0     |gpu_py36had579c0_0       216.9 MB
    tensorflow-1.12.0          |gpu_py36he74679b_0           3 KB
    _tflow_select-2.1.0        |              gpu           2 KB
    tensorboard-1.12.0         |   py36hf484d3e_0         3.1 MB
    ------------------------------------------------------------
                                           Total:       220.1 MB

The following NEW packages will be INSTALLED:

    _tflow_select:       2.1.0-gpu                
    cudatoolkit:         9.2-0                    
    cudnn:               7.2.1-cuda9.2_0          
    cupti:               9.2.148-0                
    keras-applications:  1.0.6-py36_0             
    keras-preprocessing: 1.0.5-py36_0             
    tensorboard:         1.12.0-py36hf484d3e_0    
    tensorflow:          1.12.0-gpu_py36he74679b_0
    tensorflow-base:     1.12.0-gpu_py36had579c0_0

Proceed ([y]/n)?

Running conda search tensorflow shows that CPU packages (actually two types, eigen and mkl of the latest tensorflow do exist:

conda search tensorflow
...
tensorflow               1.12.0 eigen_py27hfe19c55_0  pkgs/main           
tensorflow               1.12.0 eigen_py36hbd5f568_0  pkgs/main           
tensorflow               1.12.0 gpu_py27h2a0f108_0  pkgs/main           
tensorflow               1.12.0 gpu_py27h956c076_0  pkgs/main           
tensorflow               1.12.0 gpu_py36he68c306_0  pkgs/main           
tensorflow               1.12.0 gpu_py36he74679b_0  pkgs/main           
tensorflow               1.12.0 mkl_py27hc55d17a_0  pkgs/main           
tensorflow               1.12.0 mkl_py36h69b6ba0_0  pkgs/main

How do I tell conda to install the MKL version?

I tried conda install tensorflow[mkl] but that gives the same results as without the [mkl]. conda install tensorflow=mkl fails with PackagesNotFoundError.

like image 844
user7813790 Avatar asked Dec 04 '18 13:12

user7813790


People also ask

Can I use conda to install TensorFlow?

TensorFlow requires a recent version of pip, so upgrade your pip installation to be sure you're running the latest version. Then, install TensorFlow with pip. Note: Do not install TensorFlow with conda.


1 Answers

I found it: conda install 'tensorflow=*=mkl*'

like image 76
user7813790 Avatar answered Sep 21 '22 13:09

user7813790