Tuesday 9 October 2018

Git

Ubuntu

$ sudo apt-get update

$ sudo apt-get upgrade

$ sudo apt-get install git

$ git --version



RSA SSH keys



If you already have an RSA SSH key pair to use with GitLab

ssh-keygen -o -f ~/.ssh/id_rsa

If you don't have an existing one, Create a new one 

Go to 

gitlab settings -> SSH keys -> Generate one -> Generating new SSH key pair -> 

ssh-keygen -o -t rsa -C "your.email@example.com" -b 4096

Adding a SSH key to your GitLab account

xclip -sel clip < ~/.ssh/id_rsa.pub

Paste -> Add key

Git global setup
git config --global user.name "name"
git config --global user.email "email"
Create a new repository

git clone <copy_ssh_key>

you can test your setup by running ssh -T git@example.com (replacing example.com with your GitLab domain) and verifying that you receive a Welcome to GitLab message.

If you get this error:-

sign_and_send_pubkey: signing failed: agent refused operation

Permission denied (publickey).

Try:-

$ ssh-add

$ ssh-add -l

Monday 8 October 2018

CUDA, cuDNN and Tensorflow

Installing cuDNN on Linux

1. Installing NVIDIA Graphics Driver

2. Installing CUDA

   2.1 Install repository meta-data -
      sudo dpkg -i cuda-repo-<distro>_<version>_<architecture>.deb

   2.2 Install CUDA public GPG-key

             sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub

   2.3 Update apt repository cache
             sudo apt-get update

   2.4 Install CUDA
             sudo apt-get install cuda

   2.5 Environment setup
             export PATH=/usr/local/cuda-10.0/bin${PATH:+:${PATH}}

3  Downloading cuDNN

   3.1 Navigate to your <cudnnpath> directory containing cuDNN Debian file.

   3.2 Install the runtime library, for example:
       sudo dpkg -i libcudnn7_7.0.3.11-1+cuda9.0_amd64.deb

   3.3 Install the developer library, for example:
       sudo dpkg -i libcudnn7-dev_7.0.3.11-1+cuda9.0_amd64.deb

   3.4 Install the code samples and the cuDNN Library User Guide, for example:
       sudo dpkg -i libcudnn7-doc_7.0.3.11-1+cuda9.0_amd64.deb

Check the version of CUDA
cat /usr/local/cuda/version.txt

Check the version of cuDNN
cat /usr/include/cudnn.h | grep CUDNN_MAJOR -A 2

Tuesday 2 October 2018

No module named cv2 in jupyter notebook [SOLVED]

No issues importing cv2 in anaconda environment on terminal.
(TGS-salt-identification) chaumayu@HP-Pavilion:~$ python
Python 2.7.14 |Intel Corporation| (default, Aug  3 2018, 14:28:40)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
>>> import cv2
>>> exit()


However when I open Jupyter notebook and execute:-
import cv2
gives following error
-----------------------------------------------------------
ImportError                    Traceback(most recent call last)
-----> 1 import cv2
ImportError : No module named 'cv2' 
Do
sys.path.append('/home/chaumayu/anaconda2/envs/<env-name>/lib/python2.7/site-packages')