caffe

Caffe, how to run classify.py for a set of images

旧时模样 提交于 2019-12-08 15:25:34
I installed Caffe on Linux successfully. Then I failed to make it work with Matlab. So I installed it with Python following the tutorial of Pete Warden . However, I never used Python before I just run the command "python python/classify.py --print_results examples/images/cat.jpg foo" and it works. My question is how can I test calssify.py for a set images rather than a single image? I tried to read images from test directory as following cd caffe Python Import os For file in os.listdir(“example/images”): python/classify.py --print_results os.path.join(“examples/images/”,file) foo but it

Unable to install caffe

别说谁变了你拦得住时间么 提交于 2019-12-08 11:44:27
问题 I am new to caffe. I am trying to install it in Ubuntu 14.04 which is running as a dual boot on my macbook pro. I managed to get it running initially but soon after my laptop crashed, following which I have the same error "No module named caffe" I have followed the instructions to the letter and it seems to be an issue with opencv. I get an error message while compiling caffe which I have copied below. /usr/bin/ld: cannot find -lopencv_imgcodecs collect2: error: ld returned 1 exit status make

How to speed up caffe classifer in python

ぃ、小莉子 提交于 2019-12-08 10:39:57
问题 I am using python to use caffe classifier. I got image from my camera and peform predict image from training set. It work well but the problem is speed very slow. I thinks just 4 frames/second. Could you suggest to me some way to improve computational time in my code? The problem can be explained as following. I have to reload an network model age_net.caffemodel that its size about 80MB by following code age_net_pretrained='./age_net.caffemodel' age_net_model_file='./deploy_age.prototxt' age

Why most of the predicted results are 0 when I use a Caffe BP regression model?

做~自己de王妃 提交于 2019-12-08 08:50:31
问题 I converted my input data into hdf5 format. And each input data has a shape of 309 dims and a label the input data just as follow: part of the input data like this my net structure as follow: name: "RegressionNet" layer { name: "framert" type: "HDF5Data" top: "data" top: "label" include { phase: TRAIN } hdf5_data_param { source: "train_data_list.txt" batch_size: 100 } } layer { name: "framert" type: "HDF5Data" top: "data" top: "label" include { phase: TEST } hdf5_data_param { source: "test

Python/Caffe2: ImportError: No module named tools.setup_helpers.env

和自甴很熟 提交于 2019-12-08 08:37:35
问题 I cannot install the Python caffe2 module from the PyPi repository. When issuing sudo pip install caffe2 the following error occurs: $ sudo pip install caffe2 The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/home/user/.cache/pip' or its parent directory is not owned by the current

Layers within a layer in Caffe

£可爱£侵袭症+ 提交于 2019-12-08 07:53:15
问题 I have a custom loss layer which I wrote, this layer applies softmax and sigmoid activation to part of the bottom[0] blob. Ex: `bottom[0]` is of shape (say): `[20, 7, 7, 50]` (`NHWC` format) I would like to apply `softmax` to `[20, 7, 7, 25]` (first 25 channels) and `sigmoid` to `[20, 7, 7, 1]` (just one channel) and the remaining 24 channels are taken in as it is. How do I effectively allocate memory to the input blobs of these two softmax and sigmoid layers and also free this memory ? 回答1:

Caffe constant multiply layer

荒凉一梦 提交于 2019-12-08 07:33:05
问题 How can I define multiply constant layer in Caffe (like MulConstant in Torch). I need to add it predefined const to existing network. Caffe fails to parse my attempt to scale everything by 0.85: layers { name: "caffe.ConstantMul_0" type: "Eltwise" bottom: "caffe.SpatialConvolution_0" top: "caffe.ConstantMul_0" eltwise_param { op: MUL coeff: 0.85 } } 回答1: It is possible to do with Power Layer, just set up power to 1 and scale to whatever you need: layer { name: "caffe.ConstantMul_1" bottom:

Caffe's test accuracy during validation phase being constant when training a network

元气小坏坏 提交于 2019-12-08 06:24:16
问题 I wonder why my test accuracy keeps on getting a constant value of 0.5. I use CaffeNet network with only change in the fully connected layer's parameter where I configured num_output: 2 . My training set contains 1000 positive and 1000 negative examples whereas my validation set has 1000 positive and 1000 negative examples as well. The dataset contains images of person (whole body RGB colored). I've defined a mean file and scale value in the data layer. My network is trained to learn a person

Caffe : train network accuracy = 1 constant ! Accuracy issue

廉价感情. 提交于 2019-12-08 05:55:33
问题 Right now, I am train network with with 2 class data... but accuracy is constant 1 after first iteration ! Input data is grayscale images. both class images are randomly selected when HDF5Data creation. Why is that happened ? What's wrong or where is mistake ! network.prototxt : name: "brainMRI" layer { name: "data" type: "HDF5Data" top: "data" top: "label" include: { phase: TRAIN } hdf5_data_param { source: "/home/shivangpatel/caffe/brainMRI1/train_file_location.txt" batch_size: 10 } } layer

Using the SPP Layer in caffe results in Check failed: pad_w_ < kernel_w_ (1 vs. 1)

南楼画角 提交于 2019-12-08 05:18:55
问题 Ok, I had a previous question about using the SPP Layer in caffe. This question is a subsequent to the previous one. When using the SPP Layer I get the error output below. It seems that the images are getting too small when reaching the spp layer? The images I use are small. The width ranges between 10 and 20 px and height ranges between 30 and 35px. I0719 12:18:22.553256 2114932736 net.cpp:406] spatial_pyramid_pooling <- conv2 I0719 12:18:22.553261 2114932736 net.cpp:380] spatial_pyramid