Week 2 : Reproducing the Results of Deeply Learned Attributes for Crowd Scene Understanding (Jing Shao et al)

Getting started with www_crowd

1- Downloaded all the data related to Jing Shao's aforementioned research.
2- Cloned the repository in GitHub.
3- Watched the video regarding the research.
4- Downloaded the .caffe models and prototype.txt given.

Learning how to train my first network

5- As a tutorial, I read the official siamese network tutorial of caffe.

terms that I should be familiar with (I will update what they mean once I learn): 
  
1) Convolution

The first layer in a CNN is always a Convolutional Layer. [1] In signal processing, to convolve means to create a function using two others. [2] In this case, convolution refers to the process of multiplication of the image with the kernel in a sliding manner. The kernel will be multiplicated with a portion of the image, which we call as the receptive field, and then will slide by one pixel to do it again.

Output of the each multiplication will be only one integer. But this is not a standard matrix-multiplication, basically it is the sum of a series of element wise multiplication. You multiply all the elements with their corresponding value at the kernel, and sum all the results of these multiplications. The result therefore, will be a single value.

If that single value is high enough, there will be an activation.


2) stride  
3_a) kernel : A Convolution Matrix
3) kernel_size : Same term we use in IP. +
4) xavier_algorithm 
5) bias_filler 
6) lr_mults 
7) Pooling
8) fully connected layer
9) ReLU
10) softmax
11) multinomial logistic loss 
12) learning_rate
13) base_learning_rate
14) momentum
15) weight_decay
16) learning_rate_policy
17) learning rate policy power
18) learning rate policy gamma

6- I continued from the readme file of siamese; namely path_to/caffe/examples/siamese/readme.md

I got an error indicating that the compiler/linker cannot find the libcudart9.0.so and realized that I should now how to set an environment variable in ubuntu permanently.

First I thought that I should just use the commands such as export and it`ll be set but actually I should also change the content of my /etc/enviroment file.

so sudo gedit -H /etc/environment did the trick.

I added the terms such as CUDA_HOME and LD_LIBRARY_PATH and successfully ran ./examples/siamese/create_mnist_siamese.sh' so managed to create level_db s for training.

A very interesting line in the file :

First, we will define the model that we want to train using the siamese network.
 

So another network must be used to train one model? Both should be defined using prototype.txt s? Hmmm.


To train the "mnist siamese" network, we will use the "mnist siamese train test" network.

19) contrastive loss function
20) to optimize a function

7- I've followed the tutorial until the end. The tutorial provided a bash script that orders caffe to train the model. It also provided graphs of the networks, constructed another graph that shows the distribution of the features in 2d space.




So yea. We Trained it. We tested it. We saw that it performes well. But something is missing. We didn't see what literally happens when you run it. I searched around the web for some clue about how to test a caffe model via cmd. But about an hour later I realized that it is called DEPLOYMENT. Yep.

So in a way, caffe models are like auto-generated web apps. You design it, you test it, and you deploy it. This brings another question at the surface. How to deploy?

8-  I found some tutorial and decided to follow it. I would rather follow the official documentation but it was written in MATLAB so I thought I better find another one.

But when I tried to start to write my deployment code down, I get that error saying

Traceback (most recent call last):File "<stdin>", line 1, in <module>ImportError: No module named caffe

which is not cool at all.

But thanks to Johnny Lin, I solved the condition via running these two lines

>>> import sys
>>> sys.path.append("/home/path_to/caffe/python")










But it turns out that it was just a temporary solution. So I have to go find something permanent. Just like cuda path and library directory; I should change my environment variables. But not today. Because I cant log off from my session. that would kill my process of downloading Imagenet data.

Oh it did not work so I killed the session anyway. So I sat back and relaxed a little bit and tried it again. No import errors anymore.

Now I have to modify the code to work with my parameter set. Which contains different network models, different inputs and so on. And most importantly, I dont have a mean image.

Ok lets get to that.

9- The images I need, I already downloaded them. About 40 GB s of images but I cannot open the zipfile since I dont have the password. That means I that I have to train my own model using another dataset.

10- This means that I must construct the leveldb s from the UCSD dataset









[1] https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/ 03.01.2018 12:34
[2] https://en.wikipedia.org/wiki/Convolution

Yorumlar

Bu blogdaki popüler yayınlar

Week 1 : Installing Caffe on GTX 1050 Ubuntu 16.04

Week 5 : Stanford cs231 and KNN