Git Product home page Git Product logo

caffe-cvprw15's Introduction

Caffe-cvprw15

Deep Learning of Binary Hash Codes for Fast Image Retrieval

Created by Kevin Lin, Huei-Fang Yang, and Chu-Song Chen at Academia Sinica, Taipei, Taiwan.

Introduction

We present a simple yet effective deep learning framework to create the hash-like binary codes for fast image retrieval. We add a latent-attribute layer in the deep CNN to simultaneously learn domain specific image representations and a set of hash-like functions. Our method does not rely on pairwised similarities of data and is highly scalable to the dataset size. Experimental results show that, with only a simple modification of the deep CNN, our method improves the previous best retrieval results with 1% and 30% retrieval precision on the MNIST and CIFAR-10 datasets, respectively. We further demonstrate the scalability and efficacy of the proposed approach on the large-scale dataset of 1 million shopping images.

The details can be found in the following CVPRW 2015 paper

Citing the deep hashing works

If you find our works useful in your research, please consider citing:

Deep Learning of Binary Hash Codes for Fast Image Retrieval
K. Lin, H.-F. Yang, J.-H. Hsiao, C.-S. Chen
CVPR Workshop (CVPRW) on Deep Learning in Computer Vision, DeepVision 2015, June 2015.


Rapid Clothing Retrieval via Deep Learning of Binary Codes and Hierarchical Search
K. Lin, H.-F. Yang, K.-H. Liu, J.-H. Hsiao, C.-S. Chen
ACM International Conference on Multimedia Retrieval, ICMR 2015, June 2015.

CIFAR10 retrieval results

Performance comparison of different hashing methods on CIFAR10 dataset. The table shows the mean average precision (mAP) of top 1000 returned images with respect to different number of hash bits.

Method 12 bits 32 bits 48 bits
Ours 89.30 89.72 89.73
CNNH+ 46.50 52.10 53.20
CNNH 43.90 50.90 52.20
KSH 30.30 34.60 35.60
ITQ-CCA 26.40 28.80 29.50
LSH 12.10 12.00 12.00

Prerequisites

  1. MATLAB (tested with 2012b on 64-bit Linux)
  2. Caffe's prerequisites

Install Caffe-cvprw15

Adjust Makefile.config and simply run the following commands:

$ make all -j8
$ make test -j8
$ make runtest -j8
$ make matcaffe
$ ./download_model.sh

For a faster build, compile in parallel by doing make all -j8 where 8 is the number of parallel threads for compilation (a good choice for the number of threads is the number of cores in your machine).

Demo

This demo generates 48-bits binary codes using our model trained on CIFAR10.

Launch matlab and run demo.m

>> demo

Retrieval evaluation on CIFAR10

First, run script prepare_eval.sh to download and setup CIFAR10 dataset.

$ ./prepare_eval.sh

Second, launch matalb and run run_cifar10.m to perform the evaluation of precision at k and mean average precision at k. We set k=1000 in the experiments. The bit length of binary codes is 48. This process takes around 12 minutes.

>> run_cifar10

Then, you will get the mAP result as follows.

>> MAP = 0.897373

Moreover, simply run the following commands to generate the precision at k curves:

$ cd analysis
$ gnuplot plot-p-at-k.gnuplot 

You will reproduce the precision curves with respect to different number of top retrieved samples when the 48-bit hash codes are used in the evaluation:

Train your own model on CIFAR10

First, run script prepare_train.sh to download ImageNet pretrained model and convert CIFAR10 dataset to leveldb format. The whole process takes around 5 minutes.

$ ./prepare_train.sh

Then, go to the folder /examples/cvprw15-cifar10, and run the training script:

$ cd /examples/cvprw15-cifar10
$ chmod 777 train_48.sh
$ ./train_48.sh

The training process takes roughly 5~6 hours on a desktop with GTX Titian Black GPU. You will finally get your model named KevinNet_CIFAR10_48_iter_xxxxxx.caffemodel

To use your model, modify the model_file in demo.m to link to your model:

    model_file = './YOUR/MODEL/PATH/filename.caffemodel';

Launch matlab, run demo.m and enjoy!

>> demo

Train your own model on another dataset

It should be easy to train the model using another dataset as long as that dataset has label annotations. You need to convert the dataset into leveldb format using "create_imagenet.sh". We will show you how to do this. To be continued.

Correction of computational cost

In previous experiments, we use mex-file to call C/C++ functions from MATLAB, which slows down the process. We improve the search with pure C/C++ implementation as shown below.

Descriptor Measure Computational cost
CNN-fc7-4096 Euclidean distance 22.6 μs
BinaryHashCodes-64 Hamming distance 23.0 ps

Performing the Euclidean distance measure between two 4096-dimensional vectors takes 22.6 μs. Computing hamming distance between two 64-bit binary codes takes 23 ps (bitwise XOR operation). Thus, the proposed method is around ~982,600x faster than traditional exhaustive search with 4096-dimensional features.

Resources

Note: This documentation may contain links to third party websites, which are provided for your convenience only. Third party websites may be subject to the third party’s terms, conditions, and privacy statements.

If the automatic "fetch_data" fails, you may manually download the resouces from:

  1. For ./download_model.sh:

  2. For ./prepare_eval.sh:

  3. For ./prepare_train.sh:

Models with respect to different hash bits:

  1. The proposed deep hashing models trained on CIFAR10:

Frequently asked questions

Please refer this FAQs

Contact

Please feel free to leave suggestions or comments to Kevin Lin ([email protected]), Huei-Fang Yang ([email protected]) or Chu-Song Chen ([email protected])

caffe-cvprw15's People

Contributors

josephlewis42 avatar kevinlin311tw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

caffe-cvprw15's Issues

could someone help me with my issues

#when i execute make all -j16, this is error codes
i tried everything i can do, still can not figure it out.
thanks very much if anyone can help me.

`In file included from ./include/caffe/loss_layers.hpp:11:0,
from src/caffe/layers/contrastive_loss_layer.cpp:5:
./include/caffe/neuron_layers.hpp:383:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_;
^
./include/caffe/neuron_layers.hpp:384:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t top_desc_;
^
./include/caffe/neuron_layers.hpp:467:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_;
^
./include/caffe/neuron_layers.hpp:468:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t top_desc_;
^
./include/caffe/neuron_layers.hpp:553:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_;
^
./include/caffe/neuron_layers.hpp:554:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t top_desc_;
^
Makefile:501: recipe for target '.build_release/src/caffe/layers/contrastive_loss_layer.o' failed
make: *** [.build_release/src/caffe/layers/contrastive_loss_layer.o] Error 1
make: *** Waiting for unfinished jobs....

In file included from ./include/caffe/loss_layers.hpp:11:0,
from ./include/caffe/common_layers.hpp:12,
from ./include/caffe/vision_layers.hpp:10,
from src/caffe/layers/relu_layer.cpp:5:
./include/caffe/neuron_layers.hpp:383:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_;
^
./include/caffe/neuron_layers.hpp:384:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t top_desc_;
^
./include/caffe/neuron_layers.hpp:467:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_;
^
./include/caffe/neuron_layers.hpp:468:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t top_desc_;
^
./include/caffe/neuron_layers.hpp:553:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_;
^
./include/caffe/neuron_layers.hpp:554:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t top_desc_;
^
In file included from ./include/caffe/vision_layers.hpp:10:0,
from src/caffe/layers/relu_layer.cpp:5:
./include/caffe/common_layers.hpp:410:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_;
^
./include/caffe/common_layers.hpp:411:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t top_desc_;
^
In file included from src/caffe/layers/relu_layer.cpp:5:0:
./include/caffe/vision_layers.hpp:148:10: error: ‘cudnnTensor4dDescriptor_t’ was not declared in this scope
vector<cudnnTensor4dDescriptor_t> bottom_descs_, top_descs_;
^
./include/caffe/vision_layers.hpp:148:35: error: template argument 1 is invalid
vector<cudnnTensor4dDescriptor_t> bottom_descs_, top_descs_;
^
./include/caffe/vision_layers.hpp:148:35: error: template argument 2 is invalid
./include/caffe/vision_layers.hpp:149:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bias_desc_;
^
./include/caffe/vision_layers.hpp:347:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_, top_desc_;
^
Makefile:501: recipe for target '.build_release/src/caffe/layers/relu_layer.o' failed
make: *** [.build_release/src/caffe/layers/relu_layer.o] Error 1

In file included from ./include/caffe/loss_layers.hpp:11:0,
from ./include/caffe/common_layers.hpp:12,
from ./include/caffe/vision_layers.hpp:10,
from src/caffe/layers/euclidean_loss_layer.cpp:6:
./include/caffe/neuron_layers.hpp:383:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_;
^
./include/caffe/neuron_layers.hpp:384:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t top_desc_;
^
./include/caffe/neuron_layers.hpp:467:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_;
^
./include/caffe/neuron_layers.hpp:468:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t top_desc_;
^
./include/caffe/neuron_layers.hpp:553:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_;
^
./include/caffe/neuron_layers.hpp:554:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t top_desc_;
^
In file included from ./include/caffe/vision_layers.hpp:10:0,
from src/caffe/layers/euclidean_loss_layer.cpp:6:
./include/caffe/common_layers.hpp:410:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_;
^
./include/caffe/common_layers.hpp:411:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t top_desc_;
^
In file included from src/caffe/layers/euclidean_loss_layer.cpp:6:0:
./include/caffe/vision_layers.hpp:148:10: error: ‘cudnnTensor4dDescriptor_t’ was not declared in this scope
vector<cudnnTensor4dDescriptor_t> bottom_descs_, top_descs_;
^
./include/caffe/vision_layers.hpp:148:35: error: template argument 1 is invalid
vector<cudnnTensor4dDescriptor_t> bottom_descs_, top_descs_;
^
./include/caffe/vision_layers.hpp:148:35: error: template argument 2 is invalid
./include/caffe/vision_layers.hpp:149:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bias_desc_;
^
./include/caffe/vision_layers.hpp:347:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_, top_desc_;
^
Makefile:501: recipe for target '.build_release/src/caffe/layers/euclidean_loss_layer.o' failed
make: *** [.build_release/src/caffe/layers/euclidean_loss_layer.o] Error 1

In file included from ./include/caffe/loss_layers.hpp:11:0,
from ./include/caffe/common_layers.hpp:12,
from ./include/caffe/vision_layers.hpp:10,
from src/caffe/layers/tanh_layer.cpp:8:
./include/caffe/neuron_layers.hpp:383:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_;
^
./include/caffe/neuron_layers.hpp:384:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t top_desc_;
^
./include/caffe/neuron_layers.hpp:467:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_;
^
./include/caffe/neuron_layers.hpp:468:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t top_desc_;
^
./include/caffe/neuron_layers.hpp:553:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_;
^
./include/caffe/neuron_layers.hpp:554:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t top_desc_;
^
In file included from ./include/caffe/vision_layers.hpp:10:0,
from src/caffe/layers/tanh_layer.cpp:8:
./include/caffe/common_layers.hpp:410:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_;
^
./include/caffe/common_layers.hpp:411:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t top_desc_;
^
In file included from src/caffe/layers/tanh_layer.cpp:8:0:
./include/caffe/vision_layers.hpp:148:10: error: ‘cudnnTensor4dDescriptor_t’ was not declared in this scope
vector<cudnnTensor4dDescriptor_t> bottom_descs_, top_descs_;
^
./include/caffe/vision_layers.hpp:148:35: error: template argument 1 is invalid
vector<cudnnTensor4dDescriptor_t> bottom_descs_, top_descs_;
^
./include/caffe/vision_layers.hpp:148:35: error: template argument 2 is invalid
./include/caffe/vision_layers.hpp:149:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bias_desc_;
^
./include/caffe/vision_layers.hpp:347:3: error: ‘cudnnTensor4dDescriptor_t’ does not name a type
cudnnTensor4dDescriptor_t bottom_desc_, top_desc_;
^
Makefile:501: recipe for target '.build_release/src/caffe/layers/tanh_layer.o' failed
make: *** [.build_release/src/caffe/layers/tanh_layer.o] Error 1
`

demo.m

list_im = read_cell(filename); Do not have read_cell function

error in demo.m

I get some error in running demo.m

caffe-cvprw15 startup
>> demo
Error using textscan
'BufSize' is no longer required and has been removed.

Error in read_cell (line 11)
fileLines = textscan(fid,'%s','delimiter',linesep,'BufSize',100000);

Error in matcaffe_batch_feat (line 28)
    list_im = read_cell(filename);

Error in demo (line 29)
[feat_test , list_im] = matcaffe_batch_feat(test_file_list, use_gpu, feat_len,
model_def_file, model_file);

And I tried to run run_cafair10.m,the same error about 'BufSize'.
Did I have the wrong dataset or something incorrect in the code?

about matcaffe_batch_feat

I have a question about the extracted feature.
I read the code of matcaffe_batch_feat and found that you did not give a certain layer to extract the features just like the example in caffe. So my question is did you directly extract features from the last sigmoid layer? is the feature a 1 by 48 vector?

I get an error “error=cudaSuccess(2 vs. 0) out of memory?” when training. how can i adjust some configuration or image dataset?

As to this error, is my GPU memory too small? my GPU: GTX1050Ti 4G

At the beginning, i change both batch_size to 256 in train_prototxt file and test_prototxt file because the number of my training image is 71460 and test image is 18465, i only change this one parameter, that error occurs. i don't know if the proportion of training images and test images is correct. do you have some suggestions about this? oh, the origin size of image datasets is 250250 while cifar-10 is 3232. but i think it does't matter because when generating leveldb, the shell will resize all images to 256*256, right?

Later, i use the same configuration as your train_prototxt, test_prototxt and solver prototxt, but the highest accuracy is only about 43% and later it reduce to 0.08 gradually... do you know what the problem is?

At last i considered if my image dataset is reasonable, i craw them from taobao, i think taobao's image quality is not high because the backgroundn of image is too complex, and it may interferer training result.
Are my guessing right?

These problems have bothered me for a long time. i wish your help ,thanks!!

help

When I run $ cd analysis $ gnuplot plot-p-at-k.gnuplot no response did not draw the image, what is the reason?

About run_cifar10

After we execute the command >> run_cifar10, we get the >> MAP = 0.897373
Is this the result after reranking ? I mean the Fine-level Search.
@kevinlin311tw

Are there any pretrained hashing models that were trained on ImageNet or similar?

Hi! I was wondering if there were any pretrained models to compute image hashes that were trained on ImageNet or similar (coco, NUS-WIDE, etc).

I saw on this repo that there were models trained on Cifar10, but I was hoping to use it for some image hashes as is, ie, not re-training. Would be great if someone was willing to share their model parameters, Pytorch, caffe, whatever!

Thanks so much!

Undefined function or variable 'matcaffe_batch_feat'.

I run the scripts and get the caffemodel ,KevinNet_CIFAR10_48.caffemodel
Undefined function or variable 'matcaffe_batch_feat'.

Error in demo (line 29)
[feat_test , list_im] = matcaffe_batch_feat(test_file_list, use_gpu, feat_len,
model_def_file, model_file);

Need help!

Hi~ kevin, I get a problem shows like below after make all

[ 77%] Building CXX object tools/CMakeFiles/dump_network.bin.dir/dump_network.cpp.o
In file included from /home/aem/Downloads/caffe-cvprw15-master/tools/dump_network.cpp:23:0:
/home/aem/Downloads/caffe-cvprw15-master/include/caffe/util/io.hpp:8:18: fatal error: hdf5.h: No such file or directory
compilation terminated.
tools/CMakeFiles/dump_network.bin.dir/build.make:62: recipe for target 'tools/CMakeFiles/dump_network.bin.dir/dump_network.cpp.o' failed
make[2]: *** [tools/CMakeFiles/dump_network.bin.dir/dump_network.cpp.o] Error 1
CMakeFiles/Makefile2:4014: recipe for target 'tools/CMakeFiles/dump_network.bin.dir/all' failed
make[1]: *** [tools/CMakeFiles/dump_network.bin.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

(Ubuntu16.04 opencv3 anaconda2 Matlab2014a python2.7)
I comment USE_CUDNN := 1 and uncomment CPU_ONLY=1 like #USE_CUDNN :=1 CPU_ONLY=1
INCLUDE_DIRS := $(PYTHON_INCLUDE) $(MATLAB_INCLUDE)/usr/local/include /usr/include /usr/include/hdf5/serial/ /usr/local/cuda/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial

And try this way
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.10 /usr/lib/x86_64-linux-gnu/libhdf5.so
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.10 /usr/lib/x86_64-linux-gnu/libhdf5_hl.so

But still get the same, how could I solve this problem? Any reply will be appreciate. Thank you!

trainning myself datasets

My data set contains 10,200 images, and the next four images are classified as a single category .
The number of my category is 2500.
With the deephash network training, loss dropped from 7.1 to 3.79. Then iterate 50000 times, loss keeps stable.
I want to know if this is a normal phenomenon. How can we let loss continue to decline?

error in compiling matlab by /usr/local/MATLAB/R2014a/bin/mexext: Command not found

I use ubuntu 16.04 and your git code to compile matlab interface,matlab has already been rightly installed

and I also fix the Makefile.config by setting:
MATLAB_DIR := /usr/local/MATLAB/R2014a

but by running: make matcaffe -j40, it outputs errors like:

make: /usr/local/MATLAB/R2014a/bin/mexext: Command not found
/usr/local/MATLAB/R2014a/bin/mex matlab/caffe/matcaffe.cpp
CXX="g++"
CXXFLAGS="$CXXFLAGS -pthread -fPIC -DNDEBUG -O2 -DCPU_ONLY -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I/usr/include/hdf5/serial -I.build_release/src -I./src -I./include -Wall -Wno-sign-compare -Wno-uninitialized"
CXXLIBS="$CXXLIBS .build_release/lib/libcaffe.a -L/usr/lib -L/usr/local/lib -L/usr/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/hdf5/serial -lpthread -lglog -lgflags -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_highgui -lopencv_imgproc -lboost_thread -lcblas -latlas" -output matlab/caffe/caffe.
/bin/sh: 1: /usr/local/MATLAB/R2014a/bin/mex: not found
Makefile:400: recipe for target 'matlab/caffe/caffe.' failed
make: *** [matlab/caffe/caffe.] Error 127

in the matlab setting path, there exists the mexext in /usr/local/MATLAB/R2014a/bin/mexext, i am newer in matlab, so can you help me figure out the problem?

when I use "make all -j8", occur this errors

I has install caffe, and successfully run examples .
erros:
head lines:
make: /usr/local/MATLAB/R2012a/bin/mexext: Command not found
g++ src/caffe/net.cpp -pthread -fPIC -DNDEBUG -O2 -DUSE_MKL -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I.build_release/src -I./src -I./include -I/usr/local/cuda/include -I/opt/intel/mkl/include -Wall -Wno-sign-compare -c -o .build_release/src/caffe/net.o 2> .build_release/src/caffe/net.o.warnings.txt
|| (cat .build_release/src/caffe/net.o.warnings.txt; exit 1)

the last few lines:
compilation terminated.
make: *** [.build_release/src/caffe/blob.o] Error 1
In file included from ./include/caffe/util/math_functions.hpp:11:0,
from ./include/caffe/syncedmem.hpp:7,
from ./include/caffe/blob.hpp:6,
from ./include/caffe/layer.hpp:8,
from src/caffe/layers/absval_layer.cpp:3:
./include/caffe/util/mkl_alternate.hpp:6:17: fatal error: mkl.h: No such file or directory
#include <mkl.h>
^
compilation terminated.
make: *** [.build_release/src/caffe/layers/absval_layer.o] Error 1

How to initialize weights by using LSH ?

I don't understand how to initialize weights by LSH. I have two points, but i don't know which is true.
The one is using LSH on the dataset before the training and we can get the mapped data. Then we can use the data pair (data, mapped data) to fine tuning our Net.
The other one is that we can get the mapping matrix by LSH and use this as the weights directly.

How I can train myself datasets with ImageNe pretrained model ?

I have read the README.md file and see your words:"You need to convert the dataset into leveldb format using "create_imagenet.sh". We will show you how to do this. To be continued.". Now I want to train myself Datasets with ImageNe pretrained model ,if there are any instruction about how to convert myself Datasets format? I'm forward to your reply!

How to fine-tune the existing CNN model?

I‘m very curious about how you do it. Which codes are modified or written ??? you add a new layer the model is change, how to fine tune the alexnet.caffemodel???
Thanks a lot !!!

Check failed: error == cudaSuccess (8 vs. 0) invalid device function

I1127 10:48:39.340561 18156 net.cpp:220] Memory required for data: 219539460
I1127 10:48:39.340629 18156 solver.cpp:41] Solver scaffolding done.
I1127 10:48:39.340633 18156 caffe.cpp:115] Finetuning from ../../models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel
E1127 10:48:39.598387 18156 upgrade_proto.cpp:611] Attempting to upgrade input file specified using deprecated transformation parameters: ../../models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel
I1127 10:48:39.598426 18156 upgrade_proto.cpp:614] Successfully upgraded file specified using deprecated data transformation parameters.
E1127 10:48:39.598429 18156 upgrade_proto.cpp:616] Note that future Caffe releases will only support transform_param messages for transformation fields.
I1127 10:48:39.637908 18156 solver.cpp:160] Solving KevinNet_CIFAR10
I1127 10:48:39.637960 18156 solver.cpp:247] Iteration 0, Testing net (#0)
F1127 10:48:39.644999 18156 im2col.cu:59] Check failed: error == cudaSuccess (8 vs. 0) invalid device function
*** Check failure stack trace: ***
@ 0x7f71592fadaa (unknown)
@ 0x7f71592face4 (unknown)
@ 0x7f71592fa6e6 (unknown)
@ 0x7f71592fd687 (unknown)
@ 0x4d0a88 caffe::im2col_gpu<>()
@ 0x4bd4d7 caffe::ConvolutionLayer<>::Forward_gpu()
@ 0x457d5b caffe::Net<>::ForwardFromTo()
@ 0x458187 caffe::Net<>::ForwardPrefilled()
@ 0x48ec93 caffe::Solver<>::Test()
@ 0x48f566 caffe::Solver<>::TestAll()
@ 0x49605e caffe::Solver<>::Solve()
@ 0x4156a2 train()
@ 0x40fe31 main
@ 0x7f7156588f45 (unknown)
@ 0x4140d7 (unknown)
@ (nil) (unknown)

These problems have bothered me for a long time. i wish your help ,thanks!!

mnist dataset experiments

hello, i learn your paper and code recently, can you share the diffrents ways experiments data likes cifar10.thx

How to optimize?

I have read the paper''Deep Learning of Binary Hash Codes for Fast Image Retrieval'', but I have some questions about optimization problem . I want to apply this method to the classification problem using tensorflow framwork.
1、What is the activation function of the F8 layer? Softmax ?
2、What is the loss function?
3、How to optimize ?

why do you use imagenet's mean file on cifar-10? I think i should recreate mean file on my own image dataset,right? Hope to get your help.

train_CIFAR10_48.prototxt:
name: "KevinNet_CIFAR10"
layers {
layer {
name: "data"
type: "data"
source: "cifar10_train_leveldb"
meanfile: "../../data/ilsvrc12/imagenet_mean.binaryproto"
batchsize: 32
cropsize: 227
mirror: true
det_context_pad: 16
det_crop_mode: "warp"
det_fg_threshold: 0.5
det_bg_threshold: 0.5
det_fg_fraction: 0.25
}
top: "data"
top: "label"
}

test_CIFAR10_48.prototxt:
name: "KevinNet_CIFAR10"
layers {
layer {
name: "data"
type: "data"
source: "cifar10_val_leveldb"
meanfile: "../../data/ilsvrc12/imagenet_mean.binaryproto"
batchsize: 32
cropsize: 227
mirror: true
det_context_pad: 16
det_crop_mode: "warp"
det_fg_threshold: 0.5
det_bg_threshold: 0.5
det_fg_fraction: 0.25
}
top: "data"
top: "label"
}

error when running train_48.sh

0804 21:10:01.285056 24109 solver.cpp:58] Creating training net from train_net file: train_CIFAR10_48.prototxt
E0804 21:10:01.285750 24109 upgrade_proto.cpp:594] Attempting to upgrade input file specified using deprecated V0LayerParameter: train_CIFAR10_48.prototxt
E0804 21:10:01.286242 24109 upgrade_proto.cpp:395] Unknown parameter det_fg_threshold for layer type data
E0804 21:10:01.286269 24109 upgrade_proto.cpp:405] Unknown parameter det_bg_threshold for layer type data
E0804 21:10:01.286285 24109 upgrade_proto.cpp:415] Unknown parameter det_fg_fraction for layer type data
E0804 21:10:01.286298 24109 upgrade_proto.cpp:425] Unknown parameter det_context_pad for layer type data
E0804 21:10:01.286310 24109 upgrade_proto.cpp:435] Unknown parameter det_crop_mode for layer type data
E0804 21:10:01.286380 24109 upgrade_proto.cpp:598] Warning: had one or more problems upgrading V0NetParameter to NetParameter (see above); continuing anyway.
E0804 21:10:01.286397 24109 upgrade_proto.cpp:604] Note that future Caffe releases will not support V0NetParameter; use ./build/tools/upgrade_net_proto_text for prototxt and ./build/tools/upgrade_net_proto_binary for model weights upgrade this and any other net protos to the new format.

.........................
I0804 21:04:28.309278 24038 data_layer.cpp:45] Opening leveldb cifar10_train_leveldb
And the code just stop here, no training!!!

Hashing for VGG network

Could someone kindly please share the train_val.prototxt with VGG network to learn the binary hashing codes? Thanks a lot

Demo.m Error !!

Please help with the error. Thank You. :)

>> startup
caffe-cvprw15 startup
>> demo
    '/examples/cvprw15-cifar10/imgs/horse2.jpg'
    '/examples/cvprw15-cifar10/imgs/horse1.jpg'
    '/examples/cvprw15-cifar10/imgs/car2.jpg'
    '/examples/cvprw15-cifar10/imgs/bird2.jpg'
    '/examples/cvprw15-cifar10/imgs/bus1.jpg'
    '/examples/cvprw15-cifar10/imgs/car1.jpg'
    '/examples/cvprw15-cifar10/imgs/air1.jpg'
    '/examples/cvprw15-cifar10/imgs/bird1.jpg'
    '/examples/cvprw15-cifar10/imgs/air2.jpg'
    '/examples/cvprw15-cifar10/imgs/bus2.jpg'
    '/examples/cvprw15-cifar10/imgs/deer1.jpg'
    '/examples/cvprw15-cifar10/imgs/deer2.jpg'

Warning: Assuming batches of 10 images rest will be filled with zeros 
> In matcaffe_batch_feat at 35
  In demo at 29 
Undefined function 'caffe' for input arguments of type 'char'.

Error in matcaffe_init_feat (line 27)
  caffe('init', model_def_file, model_file)

Error in matcaffe_batch_feat (line 39)
matcaffe_init_feat(use_gpu, model_def_file, model_file);

Error in demo (line 29)
[feat_test , list_im] = matcaffe_batch_feat(test_file_list, use_gpu, feat_len, model_def_file,
model_file);

The problem about finetuning

There are some errors when run the training script ./train_48.sh:

I0831 11:56:43.312741 24302 caffe.cpp:115] Finetuning from /home/dl/zy/DLBHC/caffe-cvprw15-master/models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel
F0831 11:56:43.668262 24302 upgrade_proto.cpp:630] Check failed: ReadProtoFromBinaryFile(param_file, param) Failed to parse NetParameter file: /home/dl/zy/DLBHC/caffe-cvprw15-master/models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel
*** Check failure stack trace: ***
@ 0x7f25713c0daa (unknown)
@ 0x7f25713c0ce4 (unknown)
@ 0x7f25713c06e6 (unknown)
@ 0x7f25713c3687 (unknown)
@ 0x4cec87 caffe::ReadNetParamsFromBinaryFileOrDie()
@ 0x48318a caffe::Net<>::CopyTrainedLayersFrom()
@ 0x415be6 train()
@ 0x4101ff main
@ 0x7f256d9cfec5 (unknown)
@ 0x4143b7 (unknown)
@ (nil) (unknown)

How to solve this problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.