Oct 10, 2014

Overnight success explained


Quote of the day

" Feelings of a poor team's fans are like the relatives of a witch burnt at the stake - forced to watch the destruction of a loved one who has been condemned as a heretic "

  • Nice observation and allegory.
  • Disclaimer: Dear chetonabadi, please don't jump into any conclusion, in case you ever fall through the cracks of the internet into my scribbles.

Deep Learning: Caffe installation ubuntu 12.04

This is a concise, concrete, and step-wise instruction for installing caffe in ubuntu 12.04 (guided by the instructions given the caffe authors).

Followings are the prerequisite libraries. Carefully install it all.
  • atlas:
    • sudo apt-get install libatlas-base-dev
    • installs into "/usr/include/atlast"
  • boost:
    • sudo apt-get install libboost-all-dev
    • installs into  "/usr/include/boost"
  • OpenCV:
    • sudo apt-get install libopencv-dev
  •  hd5:
    • sudo apt-get install libhdf5-serial-dev
    • install into "/usr/lib/"
  • Addtionally, if python pip is not installed install it using aptitude.

  • google-log:
    • wget https://google-glog.googlecode.com/files/glog-0.3.3.tar.gz
    • cd glog-0.3.3
    • ./configure
    • make
    • sudo make install

  • gflags:
    • wget https://github.com/schuhschuh/gflags/archive/master.zip
    • cd gflags-master/
    • mkdir build && cd build
    • export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
    • make
    • sudo make install

  • numpy:
    • aptitude search numpy
    • sudo aptitude install python-numpy
    • install into " /usr/include/numpy"

 All the pre-requisites are installed, now we can proceed to install the caffe.
  • download the caffe
  • go into the caffe-master
  • copy and rename the Makefile.config
  • do the following change into the Makefile.config
    • # CPU-only switch (uncomment to build without GPU support).
      CPU_ONLY := 1
    • # MATLAB directory should contain the mex binary in /bin. MATLAB_DIR := /usr/local
    • PYTHON_INCLUDE := /usr/include/python2.7 \
              /usr/lib/python2.7/dist-packages/numpy/core/include
  • make all
  • make test
  • make runtest
Try out the pre-trained ImageNet model to test the caffe using python in the following reference.

 Expected issues:
  • append the PYTHONPATH into your ~/.bashrc file with. The following two instruction will do it for you.
    • make python
    • make distribute
  • anaconda GLIB issue:
    • Error: ImportError:  `GLIBC_2.15' not found caffe
    • Solution: delete the 'libm.so and libm.so.6' from ~/anaconda/lib/
  • protobuf issue:
    • Error: caffe ImportError: No module named google.protobuf caffe
    • Solution:
      • find the path where the google-protobuf is installed. for example if it install into "/usr/lib/python2.7/dist-packages/" then do the following into your script.
      • import sys
        sys.path.append("/usr/lib/python2.7/dist-packages/")








Oct 8, 2014

RGB-D sensors

  • Microsoft Kinect
  • Apple Primesense
  • Intel Realsense
  • Google Project Tango

Oct 1, 2014

git

    open a git account 
    ------------------------



   get git and set your system up with git:
  ---------------------------------------------------
  •  install using apt-get:
                    OR
  • get the requisites:
    sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev build-essential
     
  • get git:
    wget https://git-core.googlecode.com/files/git-1.8.1.2.tar.gz
     
  • unzip :
    tar -zxf git-1.8.1.2.tar.gz
     
  • go into the directory for installation
    cd git-1.8.1.2 
     
  •  install :
    make prefix=/usr/local all
    sudo make prefix=/usr/local install
  •  
  1. setup your github account into the git installed in your system
    git config --global user.name "alimurreza123"
    git config --global user.email alimurreza123@yahoo.com
    
    
  2. If everything works fine you will be able to see the already set user info using the following
    git config --list
     
    It should show:
    user.name=alimurreza123
    user.email=alimurreza123@yahoo.com
     
  3. Reference

     Create a sample project to push into the repository:
    -------------------------------------------------------------------
  • create a workspace in your machine and get into the base directory of the project named 'testing':
    • mkdir -p ~/git/testing 
      cd ~/git/testing
       
  • copy few files and directory there. In real situation you will have your project directories such data, output, src etc.
  • converting the existing project into workspace environment
    • git init
      It should show the following message:
      Initialized empty Git repository in /home/user/git/testing/.git/
  • add everything inside the 'testing' project
    • git add .
  • Push the files using commit
    • git commit -m "Initial Commit" -a
      It says you have committed all the files/folders (-a option) and your message is "Initial commint" (-m) option
      Alternately you can add files folders explicitly using by their names 
  • If you want to push it into some remote server you need to push the project using 'push' from git.
    • git remote add origin ssh://git@github.com:alimurreza123/testing.git 
    • If the above does not work try the below:
    • git remote set-url origin https://github.com/alimurreza/testing
  • Now push the project 'testing' into github repository
    • git push origin master
      It should show the something similar like this: 
      Counting objects: 6, done.
      Delta compression using up to 8 threads.
      Compressing objects: 100% (6/6), done.
      Writing objects: 100% (6/6), 2.06 KiB, done.
      Total 6 (delta 0), reused 0 (delta 0)
      To git@github.com:alimurreza123/testing.git
       * [new branch]      master -> master 
      
      
    • If the above does not work try force push as follows:
    • git push -f origin master
  • "git push tells git that we want to push our changes, "origin" is the name of our newly-configured remote server and "master" is the name of the first branch."     
  • You may need to setup you ssh-key before you can do this. Following talks about it.
  • Reference:
  •  
  • Add a folder
    • git add matlab_src
    • git add matlab_src/*
    • git commit
    • git push
  • Remove files
    • git rm afile.m
    • git commit -m "removing my file" 
    • git push
  • Update files
    •  git pull
  • set url
    • git remote set-url origin https://github.com/alimurreza/electro_migration_failure_pred
    •  
  • git commit -m "Initial commit"
  • git push
  • ssh-keygen -t ed25519 -C alimurreza@gmail.com
  • pbcopy < ~/.ssh/id_ed25519.pub
  • Go to github-->settings-->SSH & GPG Key
    • then just paste it

    Add the ssh-key if you want to push your code into the repository
    using ssh:
    -------------------------------------------------------------------------------------
  • generate the public-private key pair
  • Add the public key in your github settings
  • select the paraphrase wisely. You will be prompted to enter the paraphrase when you want to push files into remote repository such as github.
  • cloning a repository
    • git clone https://github.iu.edu/mdreza/electro_migration_failure_pred.git
  • for cloning into iu server:
    • git clone https://github.com/alimurreza/electro_migration_failure_pred.git
    • git checkout master

Reference 

Other reference:

   

Carlo Cipolla's Laws of Stupidity

    "By creating a graph of Cipolla's two factors, we obtain four groups of people. Helpless people contribute to society but are...