caffe

DataLayer placement in the .prototxt file generated by Shai's LSTM implementation

爱⌒轻易说出口 提交于 2019-12-11 11:10:31
问题 Regarding the answer provided by @Shai in LSTM module for Caffe, where caffe.NetSpec() is used to explicitly unroll LSTM units in time for training. Using this code implementation, why does the "DummyData" layer, or any data layer used instead as input X , appears at the end of the t0 time step, just before "t1/lstm/Mx" in the prototxt file? I don't get it... A manipulation (cut / paste) is hence needed. 回答1: Shai's NetSpec implementation of LSTM unrolls the net in time. Hence for every time

Caffe MemoryData Layer and Solver inteface

人走茶凉 提交于 2019-12-11 09:55:54
问题 I am trying to train a network but rather using lmdb or leveldb, I am feeding data to my network on the fly. So I am following procedure as outlined below My data is loaded in Memory Data Layer. I create a mini batch using a python script. Set data and label as solver.net.set_input_arrays(batch,labels) After that I call solver.step(1) Here solver is of type SGDSolver. Now my question is what is the difference between solver.solve() and solver.step() ? 2ndly this approach doesn't let me have a

Installing caffe on Yosemite Boost Error

血红的双手。 提交于 2019-12-11 09:43:10
问题 I am trying to install caffe on Yosemite and I am getting the following error: make: *** No rule to make target '/usr/local/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp', needed by '.build_release/cuda/src/caffe/layers/absval_layer.o'. Stop. As suggested by this blogpost compiling caffe on Yosemite I downgraded the Boost to v1.57. Any suggestions on how to move forward? 回答1: This solved the issue: make clean make all 来源: https://stackoverflow.com/questions/31297745/installing

Unknown blob input data to layer 0 in caffe

谁说胖子不能爱 提交于 2019-12-11 09:09:32
问题 I am getting following error while using my caffe prototxt: F0329 17:37:40.771555 24587 insert_splits.cpp:35] Unknown blob input data to layer 0 *** Check failure stack trace: *** The first 2 layers in my caffe prototxt is given below: layers { name: "data" type: IMAGE_DATA top: "data" top: "label" include { phase: TRAIN } image_data_param { source: "train2.txt" batch_size: 100 new_height: 28 new_width: 28 is_color: false } } layers { name: "conv1" type: CONVOLUTION bottom: "data" top: "conv1

Need help understanding the Caffe code for SigmoidCrossEntropyLossLayer for multi-label loss

偶尔善良 提交于 2019-12-11 07:54:46
问题 I need help in understanding the Caffe function, SigmoidCrossEntropyLossLayer , which is the cross-entropy error with logistic activation. Basically, the cross-entropy error for a single example with N independent targets is denoted as: - sum-over-N( t[i] * log(x[i]) + (1 - t[i]) * log(1 - x[i] ) where t is the target, 0 or 1, and x is the output, indexed by i . x , of course goes through a logistic activation. An algebraic trick for quicker cross-entropy calculation reduces the computation

Getting error for adding InfogainLoss layer?

只谈情不闲聊 提交于 2019-12-11 07:29:47
问题 I followed the instructions here to create weight matrix for classes and add the Infogainloss function, which is able to tackle my imbalance data. The few last layers .... layer { name: "score_fr" type: "Convolution" bottom: "fc7" top: "score_fr" param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0 } convolution_param { num_output: 5 #21 pad: 0 kernel_size: 1 weight_filler { type: "xavier" } bias_filler { type: "constant" } } } layer { name: "upscore" type: "Deconvolution"

How to ignore log print a unused layer in caffe

眉间皱痕 提交于 2019-12-11 07:27:48
问题 I have an prototxt as follows: layer { name: "data" type: "HDF5Data" top: "data" top: "label" include { phase: TRAIN } hdf5_data_param { source: "./train.txt" batch_size: 2 } } layer { name: "data_scale2" type: "HDF5Data" top: "data_scale2" top: "label_scale2" include { phase: TRAIN } hdf5_data_param { source: "./train_scale2.txt" batch_size: 2 } } where the second layer contains the scale factor of 2 of the original data, I named it as data_scale2 . During training, I just used the data ,

What is the difference of training a caffe network using command line and python wrapper?

只谈情不闲聊 提交于 2019-12-11 07:15:13
问题 I used a custom dice loss layer in my caffe network for binary image segmentation. Everything works fine when I trained it using caffe command line: $ caffe train -solver solver.prototxt It did converge properly. But when I tried to train the same network using python wrapper: solver = caffe.get_solver('solver.prototxt') solver.solve() I got an error: File "dice_loss_layer.py", line 42, in forward ValueError: could not broadcast input array from shape (32,160,128) into shape (32,1,160,128)

Cannot use GPU in CPU-only Caffe: check mode

两盒软妹~` 提交于 2019-12-11 06:57:13
问题 I am using a legacy set up of caffe which is running on CPU. I switched one line of code from: caffe.set_mode_cpu() to: caffe.set_mode_gpu() but I get the error: Cannot use GPU in CPU-only Caffe: check mode. I checked the Makefile.config and the relevant setting was: #CPU-only switch (uncomment to build without GPU support) CPU_only := 1 I assume 1 is True so I changed to CPU_only := 0 but it did not help. Any clues? 回答1: You need to change: #CPU-only switch (uncomment to build without GPU

Caffe CNN: multiple hierarchical losses for hierarchical classification

大城市里の小女人 提交于 2019-12-11 06:55:17
问题 I am familiar with how to use multiple loss in a CNN while all the labels of these loss are identical. My case here is handling hierarchical labels using multiple losses, as shown in figure bellow: loss1 is responsible for labelset1:{Sport, Food}. loss2 for labelset2:{volley, soccer}, loss3 for labelset3:{Pizza, Pasta, burger}. For example, Sample A∈{sport, soccer}, sample B∈{food,burger}. Any ideas how to do this? 回答1: Adding "don't care" lables, you should have three labels for each sample.