caffe

caffe what is SetLossWeights?

一个人想着一个人 提交于 2019-12-12 23:47:19
问题 I am reading caffe's Layer source code but I got following questions: What is Layer::SetLossWeights function doing? I know that inside Layer class, there is a loss_ variable, which documents: The vector that indicates whether each top blob has a non-zero weight in the objective function. Do they have some relationships ? Inside the caffe.proto file, LayerParameter loss_weight is only for loss layers, is that correct? Thanks very much. 回答1: The purpose of loss weight is to combine loss from

Implement Bhattacharyya loss function using python layer Caffe

爷,独闯天下 提交于 2019-12-12 22:25:28
问题 Trying to implement my custom loss layer using python layer,caffe. I've used this example as the guide and have wrote the forward function as follow: def forward(self,bottom,top): score = 0; self.mult[...] = np.multiply(bottom[0].data,bottom[1].data) self.multAndsqrt[...] = np.sqrt(self.mult) top[0].data[...] = -math.log(np.sum(self.multAndsqrt)) However, the second task, that is implementing the backward function is kinda much difficult for me as I'm totally unfamiliar with python. So please

Batch processing mode in Caffe - no performance gains

流过昼夜 提交于 2019-12-12 22:16:17
问题 Following on this thread I reimplemented my image processing code to send in 10 images at once (i.e. I now have the num property of the input blob set to 100 instead of 10). However, the time required to process this batch is 10 times bigger than originally. Which means that I did not get any performance increase. Is that reasonable or did I make something wrong? I am running Caffe in CPU mode. Unfortunately GPU mode is not an option for me. 回答1: Update: Caffe now natively supports parallel

tensorflow - softmax ignore negative labels (just like caffe) [duplicate]

寵の児 提交于 2019-12-12 19:51:42
问题 This question already has answers here : TensorFlow: How to handle void labeled data in image segmentation? (2 answers) Closed 2 years ago . In Caffe, there is an option with its SoftmaxWithLoss function to ignore all negative labels (-1) in computing probabilities, so that only 0 or positive label probabilities add up to 1. Is there a similar feature with Tensorflow softmax loss? 回答1: Just came up with a work-around --- I created a one-hot tensor on the label indices using tf.one_hot (with

Caffe's transformer.preprocessing takes too long to complete

大兔子大兔子 提交于 2019-12-12 19:22:46
问题 I wrote a simple script to test a model using PyCaffe , but I noticed it is extremely slow! even on GPU! My test set has 82K samples of size 256x256 and when I ran the code which is given below, it takes hours to complete. I even used batches of images instead of individual ones, yet nothing changes. Currently, it has been running for the past 5 hours, and only 50K samples are processed! What should I do to make it faster? Can I completely avoid using transformer.preprocessing ? if so how?

How to run py-faster-rcnn with X11 forwarding

元气小坏坏 提交于 2019-12-12 19:21:54
问题 I'm running py-faster-rcnn with cuDNN enabled on a g2.8xlarge EC-2 instance with Ubuntu 14.04 operating system. Everything's compiled and seems to be working fine. I log in to the remote instance via: ssh -X -i "<key.pem>" ubuntu@<IP address> I also enter the command: export DISPLAY=:0 Running ./tools/demo.py the output looks good: Loaded network /home/ubuntu/py-faster-rcnn/data/faster_rcnn_models/VGG16_faster_rcnn_final.caffemodel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Demo for data/demo/000456

How can I get layer type in pycaffe?

a 夏天 提交于 2019-12-12 19:03:27
问题 Is it possible at all to get each layer's type (e.g: Convolution, Data, etc) in pycaffe? I searched the examples provided, but I couldn't find anything. currently I'm using layers name to do my job which is extremely bad and limiting . 回答1: It's easy! import caffe net = caffe.Net('/path/to/net.prototxt', '/path/to/weights.caffemodel', caffe.TEST) # get type of 5-th layer print "type of 5-th layer is ", net.layers[5].type To map between layer names and indices you can use this simple trick:

How can I convert data which form is matlab file to LMDB as my caffe input?

别说谁变了你拦得住时间么 提交于 2019-12-12 17:20:15
问题 I have a data set which form is matlab file. The data set contains 600,000 samples and every sample is a matrix of 7-by-256. My data is not image but signal. I want to use CNN of caffe to train the data. So how can I convert it to LMDB as my input of CNN. I'm badly need the solution! 回答1: Converting data in matlab directly to lmdb might be a little tricky. Why don't you try exporting your data to hdf5 binary files (supported both by matlab and caffe)? Here is an answer describing how this can

one-hot-labelling for semantic segmentation

半腔热情 提交于 2019-12-12 17:17:05
问题 When reading the semantic segmentation paper, sometime I can read the term like one-hot labelling for mask images. I am not clear what does it really mean? When reading some implementations, I can see they are usually of the shape rows*columns*2 My guess is that one channel corresponds to foreground and the other one corresponds to background. Is that right? Further more, how can i know which one is foreground? If the existing training set is only of shape rows*columns*1 . How can I transfer

Check failed: error == cudaSuccess (2 vs. 0) out of memory

左心房为你撑大大i 提交于 2019-12-12 16:04:30
问题 I am trying to run a neural network with pycaffe on gpu. This works when I call the script for the first time. When I run the same script for the second time, CUDA throws the error in the title. Batch size is 1, image size at this moment is 243x322, the gpu has 8gb RAM. I guess I am missing a command that resets the memory? Thank you very much! EDIT: Maybe I should clarify a few things: I am running caffe on windows. When i call the script with python script.py, the process terminates and the