caffe

in caffe prototxt file. what does the TRAIN and TEST phase do?

社会主义新天地 提交于 2019-12-10 17:55:23
问题 I'm new to caffe. thank you guys! in https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto I saw 1 uncommented enum variable phase. it has 2 option TRAIN and TEST. enum Phase { TRAIN = 0; TEST = 1; } how did they work? I saw a model recently has this 2 phase too. the .prototxt file looks like: name: "CIFAR10_full" layer { name: "cifar" type: "Data" top: "data" top: "label" data_param { source: "CIFAR-10/cifar10_train_lmdb" backend: LMDB batch_size: 200 } transform_param {

Unable to import caffe

China☆狼群 提交于 2019-12-10 17:55:17
问题 I executed make pycaffe in the caffe directory and it worked fine. I also did this: gsamaras@gsamaras-A15:~/caffe/python$ export PYTHONPATH=$PYTHONPATH:/home/gsamaras/caffe/python but when I try to import caffe in another project, I get this: ImportError: No module named caffe How to fix this? Also note that in the Makefile.config of caffe, there is this line: PYTHON_INCLUDE := /usr/include/python2.7 \ <-- correct /usr/lib/python2.7/dist-packages/numpy/core/include <-- doesn't exist My numpy

RuntimeError while opening deploy.prototxt

为君一笑 提交于 2019-12-10 17:49:05
问题 I'm trying run a simple code with caffe that should open deploy.prototxt but it couldn't open the file and throws this error RuntimeError: Could not open file /home/ebadawy/git/caffemodels/bvlc_reference_caffenet/deploy.prototxt this is my code import numpy as np import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = (10, 10) # large images plt.rcParams['image.interpolation'] = 'nearest' # don't interpolate: show square pixels plt.rcParams['image.cmap'] = 'gray' # use grayscale

Caffe: Softmax with temperature

谁都会走 提交于 2019-12-10 17:28:59
问题 I am working on implementing Hinton's Knowledge distillation paper. The first step is to store the soft targets of a "cumbersome model" with a higher temperature (i.e. I don't need to train the network, just need to do forward pass per image and store the soft targets with a temperature T ). Is there a way I can get the output of Alexnet or googlenet soft targets but with a different temperature? I need to modify the soft-max with pi= exp(zi/T)/sum(exp(zi/T) . Need to divide the outputs of

Different learning rate affect to batchnorm setting. Why?

天大地大妈咪最大 提交于 2019-12-10 15:57:32
问题 I am using BatchNorm layer. I know the meaning of setting use_global_stats that often set false for training and true for testing/deploy. This is my setting in the testing phase. layer { name: "bnorm1" type: "BatchNorm" bottom: "conv1" top: "bnorm1" batch_norm_param { use_global_stats: true } } layer { name: "scale1" type: "Scale" bottom: "bnorm1" top: "bnorm1" bias_term: true scale_param { filler { value: 1 } bias_filler { value: 0.0 } } } In solver.prototxt, I used the Adam method. I found

Finding boost-python3 with Anaconda cmake prefix

守給你的承諾、 提交于 2019-12-10 15:39:55
问题 DLDR How do I point the cmake at boost-python3 library? It is not automatically detected by cmake. I'm trying to build caffe for Python 3.6 using the provided cmake. My system specs: Python 3.6.5, Anaconda custom (64-bit) Mac OS 10.13.6 No CUDA I've installing boost with brew, e.g. brew install boost boost-python3 I can see the boost libraries using find / -name libboost* 2>/dev/null . They occur in three directories /usr/local/Cellar/boost/1.67.0_1/lib/ /usr/local/lib/ -> symlink to above

Hard to understand Caffe MNIST example

心不动则不痛 提交于 2019-12-10 15:23:11
问题 After going through the Caffe tutorial here: http://caffe.berkeleyvision.org/gathered/examples/mnist.html I am really confused about the different (and efficient) model using in this tutorial, which is defined here: https://github.com/BVLC/caffe/blob/master/examples/mnist/lenet_train_test.prototxt As I understand, Convolutional layer in Caffe simply calculate the sum of Wx+b for each input, without applying any activation function. If we would like to add the activation function, we should

Object categories of pretrained imagenet model in caffe

≡放荡痞女 提交于 2019-12-10 14:12:30
问题 I'm using the pretrained imagenet model provided along the caffe (CNN) library ( 'bvlc_reference_caffenet.caffemodel' ). I can output a 1000 dim vector of object scores for any images using this model. However I don't know what the actual object categories are. Did someone find a file, where the corresponding object categories are listed? 回答1: You should look for the file 'synset_words.txt' it has 1000 line each line provides a description of a different class. For more information on how to

How did they calculate the output volume for this convnet example in Caffe?

大憨熊 提交于 2019-12-10 11:22:05
问题 In this tutorial, the output volumes are stated in output [25], and the receptive fields are specified in output [26]. Okay, the input volume [3, 227, 227] gets convolved with the region of size [3, 11, 11] . Using this formula (W−F+2P)/S+1 , where: W = the input volume size F = the receptive field size P = padding S = stride ...results with (227 - 11)/4 + 1 = 55 i.e. [55*55*96] . So far so good :) For 'pool1' they used F=3 and S=2 I think? The calculation checks out: 55-3/2+1=27 . From this

Caffe accuracy bigger than 100%

微笑、不失礼 提交于 2019-12-10 11:04:17
问题 I'm building one but, and when I use the custom train function provided on lenet example with a batch size bigger than 110 my accuracy gets bigger than 1 (100%). If I use batch size 32, I get 30 percent of accuracy. Batch size equal 64 my net accuracy is 64. And batch size equal to 128, the accuracy is 1.2. My images are 32x32. Train dataset: 56 images of Neutral faces. 60 images of Surprise faces. Test dataset: 15 images of Neutral faces. 15 images of Surprise faces. This is my code: def