Monday, April 25, 2016

TensorFlow Installation


Tensor flow installation 

$sudo apt-get install oracle-java8-installer sudo apt-get install pkg-config zip g++ zlib1g-dev unzip wget https://github
Tried to install on GCE using two methods.
The first is the default installation instructions, when running the minst demo, it appears a bit slow (650-700ms)
Also tried this script.
Also tried to install from source: see original page

git clone --recurse-submodules https://github.com/tensorflow/tensorflow -b r0.7
$ sudo apt-get install python-numpy swig python-dev
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer sudo apt-get install pkg-config zip g++ zlib1g-dev unzip wget https://github.com/bazelbuild/bazel/releases/download/0.2.1/bazel_0.2.1-linux-x86_64.deb
 then google "how to install .deb"
./configure    --> say you don't have GPU  (my case. if it's not, you read yourself...)
bazel build -c opt --copt=-mavx //tensorflow/cc:tutorials_example_trainer


Jupiter notebook
look for their installation (pip..., including the dev too)
I also installed plots:
sudo apt-get install libfreetype6-dev libxft-dev
pip install matplotlib 
open port in GCE console:  gcloud compute firewall-rules create tcp8888 --allow=tcp:8888
run on the linux shell:  (ip 0.0.0.0 is a must, otherwise only local host will work)
jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser
plotting:  if not visible, add this to the cell:  %matplotlib inline.   see a permanent solution here



installed via:
sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl

$ python -m tensorflow.models.image.mnist.convolutionalSuccessfully downloaded train-images-idx3-ubyte.gz 9912422 bytes.Successfully downloaded train-labels-idx1-ubyte.gz 28881 bytes.Successfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes.Successfully downloaded t10k-labels-idx1-ubyte.gz 4542 bytes.Extracting data/train-images-idx3-ubyte.gzExtracting data/train-labels-idx1-ubyte.gzExtracting data/t10k-images-idx3-ubyte.gzExtracting data/t10k-labels-idx1-ubyte.gzInitialized!Step 0 (epoch 0.00), 7.2 msMinibatch loss: 12.053, learning rate: 0.010000Minibatch error: 90.6%Validation error: 84.6%Step 100 (epoch 0.12), 698.7 msMinibatch loss: 3.279, learning rate: 0.010000Minibatch error: 6.2%Validation error: 7.1%Step 200 (epoch 0.23), 670.1 msMinibatch loss: 3.503, learning rate: 0.010000Minibatch error: 12.5%Validation error: 3.6%Step 300 (epoch 0.35), 666.0 msMinibatch loss: 3.199, learning rate: 0.010000Minibatch error: 7.8%Validation error: 3.4%Step 400 (epoch 0.47), 658.3 msMinibatch loss: 3.239, learning rate: 0.010000Minibatch error: 10.9%Validation error: 2.6%Step 500 (epoch 0.58), 657.4 msMinibatch loss: 3.283, learning rate: 0.010000Minibatch error: 9.4%Validation error: 2.6%

No comments: