Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing tensorflow on Linux

Tags:

tensorflow

I am trying to install Tensorflow on Linux. Unfortunately, I can barely use Ubuntu.

I followed the page "https://www.tensorflow.org/versions/master/get_started/os_setup.html#create-the-pip-package-and-install"

and I am stuck at "Create the pip package and install" part. When I typed "bazel build -c opt //tensorflow/tools/pip_package:build_pip_package" the terminal gives me below

No command 'bazel' found, did you mean:
 Command 'babel' from package 'openbabel' (universe)
 Command 'babel' from package 'babel-1.4.0' (universe)
bazel: command not found

What's wrong with it?

like image 230
아무개 Avatar asked Mar 04 '16 01:03

아무개


People also ask

Can TensorFlow run on Linux?

System requirements. TensorFlow only officially support Ubuntu. However, the following instructions may also work for other Linux distros. Note: Starting with TensorFlow 2.10 , Linux CPU-builds for Aarch64/ARM64 processors are built, maintained, tested and released by a third party: AWS.


3 Answers

You need to install "Bazel", google's homegrown build tool for building the sources. You can get it here: Installing Bazel

But if you are just getting started with this do you even need to bother with building from the source code?

Maybe you should try just installing the binaries using pip with a one line command as described here: pip installation

# Ubuntu/Linux 64-bit, CPU only:
$ sudo pip install --upgrade   https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled:
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl
like image 74
j314erre Avatar answered Oct 09 '22 15:10

j314erre


I have faced similar problem. Then I realized that I forgot to set up the environment as follows:

export PATH="$PATH:$HOME/bin"
like image 6
Hasnat Avatar answered Oct 09 '22 16:10

Hasnat


I wrote a small bash script that sets up Ubuntu to be ready to run TensorFlow. It may be of use to you:

https://github.com/jasonmayes/Tensor-Flow-on-Google-Compute-Engine

From the script here you can see how I install bazel, however that also has a number of dependencies :-)

wget https://github.com/bazelbuild/bazel/releases/download/0.1.5/bazel-0.1.5-installer-linux-x86_64.sh -O bazel-0.1.5-installer-linux-x86_64.sh
chmod +x bazel-0.1.5-installer-linux-x86_64.sh
sudo ./bazel-0.1.5-installer-linux-x86_64.sh --user
rm bazel-0.1.5-installer-linux-x86_64.sh
sudo chown $USER:$USER ~/.cache/bazel/
like image 1
Jason Mayes Avatar answered Oct 09 '22 14:10

Jason Mayes