Coder Social home page Coder Social logo

lift's Introduction

LIFT: Learned Invariant Feature Points

This software is a Python implementation of the LIFT feature point presented in [1].

[1] K. M. Yi, E. Trulls, V. Lepetit, and P. Fua. "LIFT: Learned Invariant Feature Transform", European Conference on Computer Vision (ECCV), 2016.

This software is patented and is strictly for academic purposes only. For other purposes, please contact us. When using this software, please cite [1].

Contact:

Kwang Moo Yi : kwang_dot_yi_at_epfl_dot_ch
Eduard Trulls : eduard_dot_trulls_at_epfl_dot_ch

Requirements

  • OpenCV 3

And the following python requirements:

  • Theano
  • Lasagne (Dev)
  • numpy
  • scipy
  • flufl.lock
  • parse
  • h5py

which can be installed with

pip install -r requirements.txt

Usage

Build the shared library by

cd c-code/build
cmake ..
make

To run the test program simply

./run.sh

Note

This model was trained with SfM data (Piccadilly Circus dataset), which does not have strong rotation changes. Newer models work better in this case, which will be released soon. In the meantime, you can also use the models in the learn-orientation, benchmark-orientation.

lift's People

Contributors

etrulls avatar kmyi avatar mcimpoi 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lift's Issues

Python, lib versions

I am not able to reproduce your code.
What version of Python have you used? Python2 or python3?
Also, what is the version of each requirement and the corresponding commit tags?
Thank you.

is the descriptors matched by the standard vl_ubcmatch?

(Also asked in the tf-lift repo.) I'm wondering what method you used to match the descriptors? Is it the standard vl_ubcmatch()? I want to ask this because the output descriptors are not [0-255] integers, which a lot of software takes. I don't know whether it affects anything. Thank you so much!

IndexError: too many indices for array

When I run the run.sh , error occurs as follow:
/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Parameters
#--------------------------------------------------------------------------------------

Be careful as we do not use sophisticated parsing

The parser will read until the semicolon

types are defined as below

ss: multiple strings separated with commas

s: string

b: boolean

f: float

d: int

#--------------------------------------------------------------------------------------

#--------------------------------------------------------------------------------------

Dataset parameters

ss: dataset.trainSetList = ECCV/piccadilly/; # All the first images of oxford dataset is used for training
s: dataset.dataType = ECCV; # the dataset type

#--------------------------------------------------------------------------------------

Model parameters

s: model.modelType = Combined; # the network type
b: model.bNormalizeInput = 1; # Normalize input to have zero mean and 1 std
f: model.fScaleList = np.array([1.0]); # list of scale spaces (small means larger scale)

GHH related

f: model.max_strength = -1; # GHH softmax strength (-1 for hard)

Keypoints

s: model.sDetector = tilde; # network architecture for kp
d: model.nFilterSize = 25; # Let's keep the number odd
d: model.nPatchSizeKp = 48; # patch size for kp including moving
# regions we use something smaller
s: model.sKpNonlinearity = None; # use nonlinearity at end
f: model.fScaleList = np.array([1.0]); # list of scale spaces (small means larger scale)
f: model.bias_rnd = 0.0; # random noise added to bias
f: model.epsilon = 1e-8; # epsilon for tilde

Orientation

s: model.sOrientation = cvpr16; # network architecture for orientation

Descriptor

s: model.sDescriptor = descriptor_imported; # network architecture for desc
d: model.nDescInputSize = 64; # Input size to be fed to the descriptor

s: model.descriptor_export_folder = /cvlabdata1/home/trulls-data/kpdesc/torch/export/;

L-> skipped
s: model.descriptor_model = new-CNN3-picc-iter-56k.h5; # network configuration
s: model.descriptor_input = desc-input; # Descriptor input

#--------------------------------------------------------------------------------------

Parameters for patch extraction

automatically determined

f: patch.fMaxScale = np.max(self.model.fScaleList); # asserts make sure this is stored properly
f: patch.fRatioScale = (self.model.nPatchSizeKp / 2.0) / 2.0; # to not resize when scale is 2
d: patch.nPatchSize = np.round(self.model.nDescInputSize * self.patch.fRatioScale / 6.0); # the large patch size for data. the desc will look at ratio scale of 6.0

#--------------------------------------------------------------------------------------

Validation and test time parameters

d: validation.batch_size = 100; # batch size of the implementation

d: validation.nScaleInterval = 4;

L-> skipped

d: validation.nNMSInterval = 2; # number of intervals we look for

L-> skipped

# NMS (3 would mean it goes up one

# octave in case of

# nScaleInterval=2)

#---------------------------------------------------------------------------------
Time taken to read and prepare the image is 20.172 ms
INFO: Testing double scale
resize to test is [1.95833333 1.70482819 1.48413914 1.29201816 1.12476714 0.97916667
0.85241409 0.74206957 0.64600908 0.56238357 0.48958333 0.42620705
0.37103478 0.32300454 0.28119178 0.24479167 0.21310352 0.18551739
0.16150227 0.14059589 0.12239583]
scales to test is [ 1. 1.14869835 1.31950791 1.51571657 1.74110113 2.
2.29739671 2.63901582 3.03143313 3.48220225 4. 4.59479342
5.27803164 6.06286627 6.96440451 8. 9.18958684 10.55606329
12.12573253 13.92880901 16. ]
Time taken to resize image is 19.927ms
WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be removed in the next release (v0.10). Please switch to the gpuarray backend. You can get more information about how to switch at this URL:
https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29

/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/sandbox/cuda/init.py:556: UserWarning: Theano flag device=gpu* (old gpu back-end) only support floatX=float32. You have floatX=float64. Use the new gpu back-end with device=cuda* for that value of floatX.
warnings.warn(msg)
Using gpu device 0: GeForce GTX 1060 3GB (CNMeM is disabled, cuDNN 5103)
1 #include <Python.h>
2 #include
3 #include "theano_mod_helper.h"
4 #include "cuda_ndarray.cuh"
5 //////////////////////
6 //// Support Code
7 //////////////////////
8
9 static global void kernel_reduce_ccontig_node_544270fe7a21a748315f83abfe0913cc_0(
10 const unsigned int d0,
11 const float *A,
12 float * Z)
13 {
14 const int threadCount = blockDim.x;
15 const int threadNum = threadIdx.x;
16 extern shared float buf[];
17 float myresult = 0;
18
19 if (warpSize != 32)
20 {
21 return; //TODO: set error code
22 }
23
24 for (int i0 = threadIdx.x; i0 < d0; i0 += blockDim.x)
25 {
26 myresult = myresult + A[i0];
27 }
28
29 __syncthreads(); // some kernel do multiple reduction.
30 buf[threadNum] = myresult;
31 __syncthreads();
32
33 // rest of function is handled by one warp
34 if (threadNum < warpSize)
35 {
36 //round up all the partial sums into the first warpSize elements
37 for (int i = threadNum + warpSize; i < threadCount; i += warpSize)
38 {
39 myresult = myresult + buf[i];
40 }
41 buf[threadNum] = myresult;
42 /*Comment this optimization as it don't work on Fermi GPU.
43 TODO: find why it don't work or put the GPU compute capability into the version
44 // no sync because only one warp is running
45 if(threadCount >32)
46 {buf[threadNum] = buf[threadNum] + buf[threadNum+16];buf[threadNum] = buf[threadNum] + buf[threadNum+8];buf[threadNum] = buf[threadNum] + buf[threadNum+4];buf[threadNum] = buf[threadNum] + buf[threadNum+2];buf[threadNum] = buf[threadNum] + buf[threadNum+1];
.......

nvcc fatal : Value 'sm_61' is not defined for option 'gpu-architecture'

['nvcc', '-shared', '-O3', '-arch=sm_61', '-m64', '-Xcompiler', '-fno-math-errno,-Wno-unused-label,-Wno-unused-variable,-Wno-write-strings,-DCUDA_NDARRAY_CUH=c72d035fdf91890f3b36710688069b2e,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-fPIC,-fvisibility=hidden', '-Xlinker', '-rpath,/home/lbg/.theano/compiledir_Linux-4.4--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/cuda_ndarray', '-I/home/lbg/.theano/compiledir_Linux-4.4--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/cuda_ndarray', '-I/usr/local/cuda-7.5/include', '-I/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/numpy/core/include', '-I/home/lbg/devdata/anaconda2/envs/py2/include/python2.7', '-I/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/gof', '-I/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/sandbox/cuda', '-L/home/lbg/.theano/compiledir_Linux-4.4--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/cuda_ndarray', '-L/home/lbg/devdata/anaconda2/envs/py2/lib', '-o', '/home/lbg/.theano/compiledir_Linux-4.4--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/tmp7Txrh9/544270fe7a21a748315f83abfe0913cc.so', 'mod.cu', '-lcudart', '-lcublas', '-lcuda_ndarray', '-lpython2.7']
Traceback (most recent call last):
File "compute_detector.py", line 215, in
image, verbose=False)
File "/home/lbg/devdata/LIFT/python-code/Utils/solvers.py", line 148, in TestImage
myNet = CreateNetwork4Image(pathconf, param, image, verbose=verbose)
File "/home/lbg/devdata/LIFT/python-code/Utils/solvers.py", line 93, in CreateNetwork4Image
) + '_' + param.model.modelType.lower())
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/lbg/devdata/LIFT/python-code/Utils/networks/eccv_combined.py", line 45, in
import theano
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/init.py", line 116, in
theano.sandbox.cuda.tests.test_driver.test_nvidia_driver1()
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/sandbox/cuda/tests/test_driver.py", line 32, in test_nvidia_driver1
profile=False)
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/compile/function.py", line 326, in function
output_keys=output_keys)
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/compile/pfunc.py", line 486, in pfunc
output_keys=output_keys)
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/compile/function_module.py", line 1795, in orig_function
defaults)
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/compile/function_module.py", line 1661, in create
input_storage=input_storage_lists, storage_map=storage_map)
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/gof/link.py", line 699, in make_thunk
storage_map=storage_map)[:3]
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/gof/vm.py", line 1063, in make_all
impl=impl))
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/gof/op.py", line 924, in make_thunk
no_recycling)
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/gof/op.py", line 828, in make_c_thunk
output_storage=node_output_storage)
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/gof/cc.py", line 1190, in make_thunk
keep_lock=keep_lock)
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/gof/cc.py", line 1131, in compile
keep_lock=keep_lock)
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/gof/cc.py", line 1586, in cthunk_factory
key=key, lnk=self, keep_lock=keep_lock)
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/gof/cmodule.py", line 1155, in module_from_key
module = lnk.compile_cmodule(location)
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/gof/cc.py", line 1489, in compile_cmodule
preargs=preargs)
File "/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/sandbox/cuda/nvcc_compiler.py", line 393, in compile_str
'for cmd', ' '.join(cmd))
Exception: ('The following error happened while compiling the node', GpuCAReduce{add}{1}(<CudaNdarrayType(float32, vector)>), '\n', 'nvcc return status', 1, 'for cmd', 'nvcc -shared -O3 -arch=sm_61 -m64 -Xcompiler -fno-math-errno,-Wno-unused-label,-Wno-unused-variable,-Wno-write-strings,-DCUDA_NDARRAY_CUH=c72d035fdf91890f3b36710688069b2e,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-fPIC,-fvisibility=hidden -Xlinker -rpath,/home/lbg/.theano/compiledir_Linux-4.4--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/cuda_ndarray -I/home/lbg/.theano/compiledir_Linux-4.4--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/cuda_ndarray -I/usr/local/cuda-7.5/include -I/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/numpy/core/include -I/home/lbg/devdata/anaconda2/envs/py2/include/python2.7 -I/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/gof -I/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/Theano-0.9.0rc1-py2.7.egg/theano/sandbox/cuda -L/home/lbg/.theano/compiledir_Linux-4.4--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/cuda_ndarray -L/home/lbg/devdata/anaconda2/envs/py2/lib -o /home/lbg/.theano/compiledir_Linux-4.4--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.13-64/tmp7Txrh9/544270fe7a21a748315f83abfe0913cc.so mod.cu -lcudart -lcublas -lcuda_ndarray -lpython2.7', '[GpuCAReduce{add}{1}(<CudaNdarrayType(float32, vector)>)]')
/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters


Traceback (most recent call last):
File "compute_descriptor.py", line 111, in
test_data_in = data_module.data_obj(param, image_file_name, kp_file_name)
File "/home/lbg/devdata/LIFT/python-code/Utils/dataset_tools/test.py", line 64, in init
self.load_data(param, image_file_name, kp_file_name)
File "/home/lbg/devdata/LIFT/python-code/Utils/dataset_tools/test.py", line 82, in load_data
pathconf, param, image_file_name, kp_file_name)
File "/home/lbg/devdata/LIFT/python-code/Utils/dataset_tools/test.py", line 136, in load_data_for_set
angle = np.pi / 180.0 * kp[:, IDX_ANGLE] # store angle in radians
IndexError: too many indices for array

I have no idea about it .what should i do with this error?

How to train the whole network with your provided Webcam and Oxford dataset?

The tested code provided trained descriptor/detector/orientation network. However, I hope to train those network with the provided dataset. Under python-code/Utils/networks there are files like "eccv_combined.py" "eccv_base.py" and "network_base.py", which are used to build the network architectures.
I am wondering if this is the start point to train the whole network in your paper?
Could you please give me some brief hints how to train the network with your provided Webcam and Oxford dataset? Thank you very much in advance.

A problem happens when I start ./run.sh

when I start ./run.sh, an valueError happens, which shows
" Traceback (most recent call last):
File "compute_detector.py", line 215, in
image, verbose=False)
ValueError : Invalid Value ("cpu") for configuration variable "gpu0" . Valid options start with one of "device", "opencl", "cuda" .
"

License

Hello, thank you for you amazing work. I just have one question, is only this source code patented, or the whole idea of using LIFT is also restricted ?

‘img1_kp.txt’ with ‘img1_ori.txt’

Hello,
Bother you again. After I run your code,the results appear . but
I want to ask the difference between ‘img1_kp.txt’ and‘img1_ori.txt’ in results.
why in ‘img1_kp.txt’ the keypoints is 1000, and in ‘img1_ori.txt’ the keypoints is 974.
what's the defference?
Thanks

Problems arise when running ./run.sh

Hello
There are some problems when I run ./run.sh. And I can't find the way to solve it.
Traceback (most recent call last):
File "compute_detector.py", line 47, in
from Utils.sift_tools import recomputeOrientation
File "/home/hoo104/LIFT/python-code/Utils/sift_tools.py", line 48, in
libSIFT = cdll.LoadLibrary('../c-code/libSIFT.so')
File "/home/hoo104/anaconda3/lib/python3.5/ctypes/init.py", line 425, in LoadLibrary
return self._dlltype(name)
File "/home/hoo104/anaconda3/lib/python3.5/ctypes/init.py", line 347, in init
self._handle = _dlopen(self._name, mode)
OSError: ../c-code/libSIFT.so: undefined symbol: _ZN2cv3hal9fastAtan2EPKfS2_Pfib
Parameters
#--------------------------------------------------------------------------------------

Be careful as we do not use sophisticated parsing

The parser will read until the semicolon

types are defined as below

ss: multiple strings separated with commas

s: string

b: boolean

f: float

d: int

#--------------------------------------------------------------------------------------

#--------------------------------------------------------------------------------------

Dataset parameters

ss: dataset.trainSetList = ECCV/piccadilly/; # All the first images of oxford dataset is used for training
s: dataset.dataType = ECCV; # the dataset type

#--------------------------------------------------------------------------------------

Model parameters

s: model.modelType = Combined; # the network type
b: model.bNormalizeInput = 1; # Normalize input to have zero mean and 1 std
f: model.fScaleList = np.array([1.0]); # list of scale spaces (small means larger scale)

GHH related

f: model.max_strength = -1; # GHH softmax strength (-1 for hard)

Keypoints

s: model.sDetector = tilde; # network architecture for kp
d: model.nFilterSize = 25; # Let's keep the number odd
d: model.nPatchSizeKp = 48; # patch size for kp including moving
# regions we use something smaller
s: model.sKpNonlinearity = None; # use nonlinearity at end
f: model.fScaleList = np.array([1.0]); # list of scale spaces (small means larger scale)
f: model.bias_rnd = 0.0; # random noise added to bias
f: model.epsilon = 1e-8; # epsilon for tilde

Orientation

s: model.sOrientation = cvpr16; # network architecture for orientation

Descriptor

s: model.sDescriptor = descriptor_imported; # network architecture for desc
d: model.nDescInputSize = 64; # Input size to be fed to the descriptor

s: model.descriptor_export_folder = /cvlabdata1/home/trulls-data/kpdesc/torch/export/;

L-> skipped
s: model.descriptor_model = new-CNN3-picc-iter-56k.h5; # network configuration
s: model.descriptor_input = desc-input; # Descriptor input

#--------------------------------------------------------------------------------------

Parameters for patch extraction

automatically determined

f: patch.fMaxScale = np.max(self.model.fScaleList); # asserts make sure this is stored properly
f: patch.fRatioScale = (self.model.nPatchSizeKp / 2.0) / 2.0; # to not resize when scale is 2
d: patch.nPatchSize = np.round(self.model.nDescInputSize * self.patch.fRatioScale / 6.0); # the large patch size for data. the desc will look at ratio scale of 6.0

#--------------------------------------------------------------------------------------

Validation and test time parameters

d: validation.batch_size = 100; # batch size of the implementation

d: validation.nScaleInterval = 4;

L-> skipped

d: validation.nNMSInterval = 2; # number of intervals we look for

L-> skipped

# NMS (3 would mean it goes up one

# octave in case of

# nScaleInterval=2)

#---------------------------------------------------------------------------------

Test Data Module

Traceback (most recent call last):
File "compute_orientation.py", line 107, in
test_data_in = data_module.data_obj(param, image_file_name, kp_file_name)
File "/home/hoo104/LIFT/python-code/Utils/dataset_tools/test.py", line 64, in init
self.load_data(param, image_file_name, kp_file_name)
File "/home/hoo104/LIFT/python-code/Utils/dataset_tools/test.py", line 82, in load_data
pathconf, param, image_file_name, kp_file_name)
File "/home/hoo104/LIFT/python-code/Utils/dataset_tools/test.py", line 129, in load_data_for_set
kp = np.asarray(loadKpListFromTxt(kp_file_name))
File "/home/hoo104/LIFT/python-code/Utils/kp_tools.py", line 196, in loadKpListFromTxt
kp_file = open(kp_file_name, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/home/hoo104/LIFT/results/img1_kp.txt'
Parameters
#--------------------------------------------------------------------------------------

Be careful as we do not use sophisticated parsing

The parser will read until the semicolon

types are defined as below

ss: multiple strings separated with commas

s: string

b: boolean

f: float

d: int

#--------------------------------------------------------------------------------------

#--------------------------------------------------------------------------------------

Dataset parameters

ss: dataset.trainSetList = ECCV/piccadilly/; # All the first images of oxford dataset is used for training
s: dataset.dataType = ECCV; # the dataset type

#--------------------------------------------------------------------------------------

Model parameters

s: model.modelType = Combined; # the network type
b: model.bNormalizeInput = 1; # Normalize input to have zero mean and 1 std
f: model.fScaleList = np.array([1.0]); # list of scale spaces (small means larger scale)

GHH related

f: model.max_strength = -1; # GHH softmax strength (-1 for hard)

Keypoints

s: model.sDetector = tilde; # network architecture for kp
d: model.nFilterSize = 25; # Let's keep the number odd
d: model.nPatchSizeKp = 48; # patch size for kp including moving
# regions we use something smaller
s: model.sKpNonlinearity = None; # use nonlinearity at end
f: model.fScaleList = np.array([1.0]); # list of scale spaces (small means larger scale)
f: model.bias_rnd = 0.0; # random noise added to bias
f: model.epsilon = 1e-8; # epsilon for tilde

Orientation

s: model.sOrientation = cvpr16; # network architecture for orientation

Descriptor

s: model.sDescriptor = descriptor_imported; # network architecture for desc
d: model.nDescInputSize = 64; # Input size to be fed to the descriptor

s: model.descriptor_export_folder = /cvlabdata1/home/trulls-data/kpdesc/torch/export/;

L-> skipped
s: model.descriptor_model = new-CNN3-picc-iter-56k.h5; # network configuration
s: model.descriptor_input = desc-input; # Descriptor input

#--------------------------------------------------------------------------------------

Parameters for patch extraction

automatically determined

f: patch.fMaxScale = np.max(self.model.fScaleList); # asserts make sure this is stored properly
f: patch.fRatioScale = (self.model.nPatchSizeKp / 2.0) / 2.0; # to not resize when scale is 2
d: patch.nPatchSize = np.round(self.model.nDescInputSize * self.patch.fRatioScale / 6.0); # the large patch size for data. the desc will look at ratio scale of 6.0

#--------------------------------------------------------------------------------------

Validation and test time parameters

d: validation.batch_size = 100; # batch size of the implementation

d: validation.nScaleInterval = 4;

L-> skipped

d: validation.nNMSInterval = 2; # number of intervals we look for

L-> skipped

# NMS (3 would mean it goes up one

# octave in case of

# nScaleInterval=2)

#---------------------------------------------------------------------------------

Test Data Module

Traceback (most recent call last):
File "compute_descriptor.py", line 111, in
test_data_in = data_module.data_obj(param, image_file_name, kp_file_name)
File "/home/hoo104/LIFT/python-code/Utils/dataset_tools/test.py", line 64, in init
self.load_data(param, image_file_name, kp_file_name)
File "/home/hoo104/LIFT/python-code/Utils/dataset_tools/test.py", line 82, in load_data
pathconf, param, image_file_name, kp_file_name)
File "/home/hoo104/LIFT/python-code/Utils/dataset_tools/test.py", line 135, in load_data_for_set
angle = np.pi / 180.0 * kp[:, IDX_ANGLE] # store angle in radians
IndexError: too many indices for array

What if I set _LIFT_USE_THEANO=0 ??

I got a question. Since my GPU doesn't support cuDNN. I edited the run.sh file and set the _LIFT_USE_THEANO=0 . As a result, the code seems to run well without any error, except some warning. And I got a result image named img1_kp.txt.jpg in the result directory. Any thing wrong with me ?? thank you!

Is Windows ok?

Thanks for your codes! I just wanna know can these codes run under window OS? Thx

problem in matching

Hi Professor,thank you for sharing the code!

I have extracted features by using the pretrained model and matched them following this issue ,but the matching result seems not good enough, even when i matched the picture with its rotated one, there also are a lot of error pairs in result picture. Is there something i can do to promote the matching performance? May i need to retrain the model?

I am looking forward to your reply, thanks a lot!

here is the result when the picture were matched with its rotated one.
L3

Some problems about patch size

Hello!
I don't understand the patch size setting in your paper "LIFT: Learned Invariant Feature Transform".Why the 24σ ×24σ support region correspond to 128X128 ? And where the sift descriptor say it support region size is12σ ?
Looking forward to your reply!

Image Mactching

Hi
Trying to do image matching as shown in the figure.

Was able to generate the keypoints. each key point has a descriptor of size 128. However how to know the location of the keypoints (which is of size 12 ). Is there a script that I can follow.

How to generate the data for training descriptor network

Hi,
I'm Jack. I recently trained a model of descriptor network but it didn't work well. Could you tell me how your data set for training descriptor network generate? And could you tell me the validation err you get when training the descriptor network(mine is about 2.1)?
My process:
1. Pick a structure, then re-project it back into two features in two corresponding images;
2. Pick another structure very close to the former one, also re-project it back;
3. In each image, I have two projected feature points, I can get the direction and scale from it;
4. Then I crop a patch according to each feature point's direction and scale.

That's what I get for example:
github_iss1

Thanks!!! :)

Why the angles are all nearly the same?

Hi,
Jack again,
I recently trained several descriptor models, but they all failed to meet the performance as yours. And the possible difference between yours and mine is the dataset (and maybe the training strategy, but I thought it didn't matter that much). Then I found that the angles generated by your model are all nearly the same(about 135)...Could you give me any explanation, please? Thanks in advance. @kmyid

Cannot run.sh

Hi,
I am able to compile all your source code.

However as I try to run.sh I get following error:

[mpkuse@deephorse LIFT]$ ./run.sh 
Parameters
#--------------------------------------------------------------------------------------
# Be careful as we do not use sophisticated parsing
# The parser will read until the semicolon
# 
# types are defined as below
# ss: multiple strings separated with commas
# s: string
# b: boolean
# f: float
# d: int
#--------------------------------------------------------------------------------------

#--------------------------------------------------------------------------------------
# Dataset parameters
ss: dataset.trainSetList = ECCV/piccadilly/; # All the first images of oxford dataset is used for training
s: dataset.dataType = ECCV;	  # the dataset type

#--------------------------------------------------------------------------------------
# Model parameters
s: model.modelType = Combined;	  # the network type
b: model.bNormalizeInput = 1;  	  # Normalize input to have zero mean and 1 std
f: model.fScaleList = np.array([1.0]); 	     # list of scale spaces (small means larger scale)

# GHH related
f: model.max_strength = -1;	# GHH softmax strength (-1 for hard)

# Keypoints
s: model.sDetector = tilde;	   # network architecture for kp
d: model.nFilterSize = 25;	  # Let's keep the number odd
d: model.nPatchSizeKp = 48;       # patch size for kp including moving
				  # regions we use something smaller
s: model.sKpNonlinearity = None; # use nonlinearity at end
f: model.fScaleList = np.array([1.0]); 	     # list of scale spaces (small means larger scale)
f: model.bias_rnd = 0.0;		# random noise added to bias
f: model.epsilon = 1e-8;		# epsilon for tilde

# Orientation
s: model.sOrientation = cvpr16;	   # network architecture for orientation

# Descriptor
s: model.sDescriptor = descriptor_imported;	   # network architecture for desc
d: model.nDescInputSize = 64;	  # Input size to be fed to the descriptor
# s: model.descriptor_export_folder = /cvlabdata1/home/trulls-data/kpdesc/torch/export/; 
  L-> skipped
s: model.descriptor_model = new-CNN3-picc-iter-56k.h5; # network configuration
s: model.descriptor_input = desc-input;	 # Descriptor input

#--------------------------------------------------------------------------------------
# Parameters for patch extraction

# automatically determined
f: patch.fMaxScale = np.max(self.model.fScaleList); # asserts make sure this is stored properly
f: patch.fRatioScale = (self.model.nPatchSizeKp / 2.0) / 2.0;	# to not resize when scale is 2
d: patch.nPatchSize = np.round(self.model.nDescInputSize * self.patch.fRatioScale / 6.0); # the large patch size for data. the desc will look at ratio scale of 6.0

#--------------------------------------------------------------------------------------
# Validation and test time parameters
d: validation.batch_size = 100;		# batch size of the implementation

# d: validation.nScaleInterval = 4;
  L-> skipped
# d: validation.nNMSInterval = 2;	  # number of intervals we look for
  L-> skipped
# 				  # NMS (3 would mean it goes up one
# 				  # octave in case of
# 				  # nScaleInterval=2)
#---------------------------------------------------------------------------------
Time taken to read and prepare the image is 189.155 ms
INFO: Testing double scale
resize to test is [ 1.95833333  1.70482819  1.48413914  1.29201816  1.12476714  0.97916667
  0.85241409  0.74206957  0.64600908  0.56238357  0.48958333  0.42620705
  0.37103478  0.32300454  0.28119178  0.24479167  0.21310352  0.18551739
  0.16150227  0.14059589  0.12239583]
scales to test is [  1.           1.14869835   1.31950791   1.51571657   1.74110113   2.
   2.29739671   2.63901582   3.03143313   3.48220225   4.           4.59479342
   5.27803164   6.06286627   6.96440451   8.           9.18958684
  10.55606329  12.12573253  13.92880901  16.        ]
Time taken to resize image is 24.637ms
Traceback (most recent call last):
  File "compute_detector.py", line 215, in <module>
    image, verbose=False)
  File "/home/mpkuse/Downloads/LIFT/python-code/Utils/solvers.py", line 148, in TestImage
    myNet = CreateNetwork4Image(pathconf, param, image, verbose=verbose)
  File "/home/mpkuse/Downloads/LIFT/python-code/Utils/solvers.py", line 93, in CreateNetwork4Image
    ) + '_' + param.model.modelType.lower())
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/mpkuse/Downloads/LIFT/python-code/Utils/networks/eccv_combined.py", line 45, in <module>
    import theano
  File "/usr/local/lib/python2.7/dist-packages/theano/__init__.py", line 88, in <module>
    from theano.configdefaults import config
  File "/usr/local/lib/python2.7/dist-packages/theano/configdefaults.py", line 137, in <module>
    in_c_key=False)
  File "/usr/local/lib/python2.7/dist-packages/theano/configparser.py", line 287, in AddConfigVar
    configparam.__get__(root, type(root), delete_key=True)
  File "/usr/local/lib/python2.7/dist-packages/theano/configparser.py", line 335, in __get__
    self.__set__(cls, val_str)
  File "/usr/local/lib/python2.7/dist-packages/theano/configparser.py", line 346, in __set__
    self.val = self.filter(val)
  File "/usr/local/lib/python2.7/dist-packages/theano/configdefaults.py", line 116, in filter
    'You are tring to use the old GPU back-end. '
ValueError: You are tring to use the old GPU back-end. It was removed from Theano. Use device=cuda* now. See https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29 for more information.
Parameters

Do you know how can I fix this and run your code?

Hard mining the Descriptor network

I follow your advice of adding hard mining, and the performance of descriptor network work better than before but its still far worse compared to your released version. I wondering if there is anything I can pay attention to? Have you pre-trained the network before mining? And I extract patch with 6*sift_scale as radius for descriptor input, is it right? As for the mining rate, I double the mining rate every 5000 batches, so the mining rate become 1 at the 35000th iteration, is it the same as what you described in the paper?
I really appreciate your help because I have spent so much time in this part. Faint....

Spatial Transformer

Hi,

Could you tell me how you use the spatial transformer function, ie which function is used to transform the input patch to the descriptor network according to the orientation?

Segmentation fault (cure dumped) when python compute_detector.py......

when i run the run.sh , and use opencv3.1.0 to get libSIFT.so , error occurs as follow:
./run.sh: line 74: 3091 Segmentation fault (core dumped) python compute_detector.py $_LIFT_TEST_CONFIG $_LIFT_TEST_IMG $_LIFT_KP_FILE_NAME $_LIFT_SAVE_PNG $_LIFT_USE_THEANO 0 $_LIFT_MODEL_DIR $_LIFT_NUM_KEYPOINT
/home/lbg/devdata/anaconda2/envs/py2/lib/python2.7/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "compute_orientation.py", line 107, in
test_data_in = data_module.data_obj(param, image_file_name, kp_file_name)
File "/home/lbg/devdata/LIFT/python-code/Utils/dataset_tools/test.py", line 64, in init
self.load_data(param, image_file_name, kp_file_name)
File "/home/lbg/devdata/LIFT/python-code/Utils/dataset_tools/test.py", line 82, in load_data
pathconf, param, image_file_name, kp_file_name)
File "/home/lbg/devdata/LIFT/python-code/Utils/dataset_tools/test.py", line 136, in load_data_for_set
angle = np.pi / 180.0 * kp[:, IDX_ANGLE] # store angle in radians
IndexError: too many indices for array

And i localizate the error at sift_tools.py line 77:libSIFT.recomputeOrientation(c_void_p(indata.ctypes.data).
but i have no idea about it...what should i do with this error?
thanks a lot

about feature points matching

From your project,I don't know how to match the feature points between two pictures as described in your paper. Could you show some details about matching???
thanks
best regards

Match well with the train model which has big change

Hi,
I am a researcher from Chinese Academy of Sciences China.
Recently,I have read your paper named LIFT: Learned Invariant Feature Transform and dowloaded your code.
It does me a lot of me.I have used your train model to get descriptor,and can get the good match,However,When I use the other two picture which have strong rotation change,the match is not very well.
I read your file named "README.md",in this file,you said "This model was trained with SfM data, which does not have strong rotation changes. Newer models work better in this case",I want to use your new models for scientific research.Would you send me a copy to email [email protected] if it is convenient,Thank you.

Speed of code

Hello,
Thanks for releasing the code!

I've been playing with it and I noticed that it is a little slow. My measurements for the test image provided in the repo are (using a very recent TitanX):

  • 1m33s for keypoint detection
  • 13.9s for orientation estimation
  • 13.s for descriptor computation
    TOTAL: 2min/image

Questions:

  • Does this timing agree with what you experience when using the code? [hopefully I am not doing something wrong! :)]
  • Are you planning to release a faster version of the code? I am trying to use LIFT for large-scale image retrieval (eg, think of replacing SIFT in this context). Do you think this is currently possible?

Thank you again!

This code includes learning procedure?

Hi,
I find that your release code is only for test (corresponding to Run-time pipeline sec. 3.6 in paper), but if I want to train whole network, do you provide codes about learning procedure?

Another problem is about patch. I saw your code in compute_detector.py, your input is a image, I can't find how did you construct the quadruplets patches.

Thanks.

ImportError: No module named flufl.lock

when i run the file run.sh, error occurs as follow:
Traceback (most recent call last):
File “compute_detector.py”, line 43, in
from Utils.custom_types import paramGroup, paramStruct, pathConfig
File “/home/mitc/demo/LIFT-master/python-code/Utils/custom_types.py”, line 45, in
from flufl.lock import Lock
ImportError: No module named flufl.lock
Traceback (most recent call last):
File “compute_orientation.py”, line 40, in
from Utils.custom_types import paramGroup, paramStruct, pathConfig
File “/home/mitc/demo/LIFT-master/python-code/Utils/custom_types.py”, line 45, in
from flufl.lock import Lock
ImportError: No module named flufl.lock
Traceback (most recent call last):
File “compute_descriptor.py”, line 41, in
from Utils.custom_types import paramGroup, paramStruct, pathConfig
File “/home/mitc/demo/LIFT-master/python-code/Utils/custom_types.py”, line 45, in
from flufl.lock import Lock
ImportError: No module named flufl.lock

i have tried to install flufl.lock use "pip3 install flufl.lock",but it doesn't work. what should i do with this error?

model and config files

Hi,
I figured out the correct versions of theano and flufl.lock. I think i got it running.

In the folder python-code, I am trying to compute_detector.py.
Traceback (most recent call last):
File "compute_detector.py", line 61, in
raise RuntimeError('USAGE: python compute_detector.py '
RuntimeError: USAGE: python compute_detector.py <config_file> <image_file> <output_file> <bPrintTime/optional> <model_dir/optional> <num_keypoint/optional>

Where can I get the config_file and the model ?

when will the LIFT package be released

Hi, @etrulls ,

Glad to see your promising work. BTW, when do yo plan to release your LIFT package? Furthermore, which DL framework did you use to produce your Deep Network architecture? Caffe, Torch, Matconvnet, tensorflow, etc...? Please also drop a message in Issues section for release notification when it is ready.

Thanks~

flufl.lock installation issue

Hi, I have an issue installation of flufl.lock. Is this package absolutely needed?
I notice you have used the lock() in custom_types.py. Will this effect the code? I am just wanting to try out this code for my images.

error: ‘CV_StsBadArg’ was not declared in this scope

Hello,

I am attempting to install the library, however i keep running into this problem. I assumed, the problem is because of the updated opencv library, therefore i add some more directory into the sift.cpp file. The error disappears and the make is successful. But later i stumple upon [Errno 2] No such file or directory: '/home/hoo104/LIFT/results/img1_ori.txt' error.
I am using conda 2, python 2.7, opencv3.4, cuda 8. Any suggestions to resolve this error.

Thank You

Running error in Linux - Help appreciated

Hello! I ran into mainly 4 problems when try to run the code. But in order to get things more clearly, I screenshot all the commanding info. (linux 16)

  1. In the 3rd picture, when I ./run.sh, libSIFT.so has a undefined symbol problem
  2. In the 7th picture, still during the running, in the test data module part, it can't find the file img1_kp.txt in result filefolder
  3. In the last picture, in the other test module part, it can't find img_ori.txt in result filefolder
  4. Are these 2 files generated during compiling? Because there is no file in the reuslt filefolder. Is it to say my cmake.. make are failed to some extent? Because when I try cmake .. it gives me a warning and says OpenCV_DIR should be manually point to my build of opencv library, even if I write 'export OpenCV_DIR=<path_of_opencv/build>' in terminal. But actually I got configuration and gerneration done at last.
    I would be quite appreciated if you could give me some hints to continue. I have struggled with it for some days.... THANKS!

1
image
2.
image
3.
image
4.
image
5.
image
6.
image
7.
image
8.
image

image
10.
image
11.
image

Requirements file is not specified enough

Tried to get the code to work but it seems the requirements are not backwards compatible. Can you specify package versions in the requirements file?

I've tried the following:

conda create -n lift anaconda 
pip install -r requirements 
cd c-code/build 
cmake ..
make 
cd .. 
cd .. 
./run.sh 

errors: first they were related to opencv, then flock, then hd5py, then ....

Can you please provide a more specified list such as
numpy=1.12

Thanks

Some Problems on Building

When I build LIFT code on MACOS, it always appear problem on the "cmake .. '' step.As follows,
**CMake Warning (dev) in CMakeLists.txt:
AUTOGEN: No valid Qt version found for target SIFT. AUTOMOC disabled.
Consider adding:

find_package(Qt<QTVERSION> COMPONENTS Core)

to your CMakeLists.txt file.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

SIFT

This warning is for project developers. Use -Wno-dev to suppress it.**
Thanks very much for noting this problem!

Different Weights but the Same Output Descriptors?

Hi,
My name is Jack. I have to say that your work is very attractive and I want to do the training work by my own. Recently, when I tried to replace the descriptor model you provided(new-CNN3-picc-iter-56k.h5) with my trained model, I found that the descriptors generated from both model are all the same. Then I just simply set all the weights and bias to zero, the descriptors generated still remain the same. I don't know what's wrong. Could you give me any explanation? Thanks in advance!

What I do it's simple copy the provided model and change the weights and bias. And then I changed "s: model.descriptor_model = ..." to my trained model's name.

Soft Argmax implementation

Hi Dr. Yi -- question about the soft argmax mentioned in the paper. Given logits [0.1, 0.7, 0.05, 0.15], where the hard argmax would be 1, the soft argmax delivers 1.007 (as shown below). How can you use that float as a hard index (i.e. integer)? Or does the STN not need an integer to extract the patch?

import numpy as np
x = np.arange(4)
y = np.array([0.1,0.7, 0.05, 0.15])
result = np.sum( np.exp(y * 10) * x)
result / np.sum( np.exp(y * 10))
1.007140612556097

Could you also point me to where in the codebase you are performing this step? Thank you!

Details about the pre-training process for detector and data extraction

Hi,
Happy new year! Sorry to bother you again. I trained the descriptor model using hard sample mining, and it do work much better than before.
1.And I notice that in your paper, you said you add a 4.8% random perturbations to the location of keypoints. Do you add the perturbation since training the descriptor network or since training the detector network?
2.How do you extract the non-feature point from images? I choose those postion away from the feature points survive through the Visual SfM reconstruction instead all the sift feature points. Is it making sense?
3.How should I set up the balance factor(gamma) based on the data? I use(Pseudocode):

   accumulate_pair_loss = 0
   accumulate_class_loss = 0
   while not converged:
       pair_loss = ...
       class_loss = ...
       accumulate_pair_loss += pair_loss
       accumulate_class_loss += class_loss
       gamma = accumulate_pair_loss/accumulate_class_loss
       loss = gamma*class_loss+pair_loss
       update
       ...

4.Could you give me some hints about how to compute the second term (I guess it's the IOU?) in the overlap loss in the pre-training phase?
Thanks very much!!
@kmyid

error

#--------------------------------------------------------------------------------------

Parameters for patch extraction

automatically determined

f: patch.fMaxScale = np.max(self.model.fScaleList); # asserts make sure this is stored properly
f: patch.fRatioScale = (self.model.nPatchSizeKp / 2.0) / 2.0; # to not resize when scale is 2
d: patch.nPatchSize = np.round(self.model.nDescInputSize * self.patch.fRatioScale / 6.0); # the large patch size for data. the desc will look at ratio scale of 6.0

#--------------------------------------------------------------------------------------

Validation and test time parameters

d: validation.batch_size = 100; # batch size of the implementation

d: validation.nScaleInterval = 4;

L-> skipped

d: validation.nNMSInterval = 2; # number of intervals we look for

L-> skipped

# NMS (3 would mean it goes up one

# octave in case of

# nScaleInterval=2)

#---------------------------------------------------------------------------------

Test Data Module

Traceback (most recent call last):
File "compute_descriptor.py", line 111, in
test_data_in = data_module.data_obj(param, image_file_name, kp_file_name)
File "/home/ynh/下载/LIFT/LIFT-master/python-code/Utils/dataset_tools/test.py", line 64, in init
self.load_data(param, image_file_name, kp_file_name)
File "/home/ynh/下载/LIFT/LIFT-master/python-code/Utils/dataset_tools/test.py", line 82, in load_data
pathconf, param, image_file_name, kp_file_name)
File "/home/ynh/下载/LIFT/LIFT-master/python-code/Utils/dataset_tools/test.py", line 129, in load_data_for_set
kp = np.asarray(loadKpListFromTxt(kp_file_name))
File "/home/ynh/下载/LIFT/LIFT-master/python-code/Utils/kp_tools.py", line 196, in loadKpListFromTxt
kp_file = open(kp_file_name, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/home/ynh/下载/LIFT/LIFT-master/results/img1_ori.txt'

OpenCV

I am getting this error...after cmake ..
Can you help me?

CMake Warning at /home/nsilva/opencv-2.4.11/cmake/OpenCVConfig.cmake:161 (message):
Found OpenCV Windows Pack but it has not binaries compatible with your
configuration.

You should manually point CMake variable OpenCV_DIR to your build of OpenCV
library.
Call Stack (most recent call first):
CMakeLists.txt:11 (find_package)

CMake Error at CMakeLists.txt:11 (find_package):
Found package configuration file:

/home/nsilva/opencv-2.4.11/cmake/OpenCVConfig.cmake

but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.

-- Configuring incomplete, errors occurred!
See also "/home/nsilva/Documents/python/theano/LIFT/c-code/build/CMakeFiles/CMakeOutput.log".

How can I run this program with cudnn?

Hi!
Thanks for releasing the code!

When I run the test program,it reports the following bug.


Time taken to read and prepare the image is 135.346 ms
INFO: Testing double scale
resize to test is [ 1.95833333  1.70482819  1.48413914  1.29201816  1.12476714  0.97916667
  0.85241409  0.74206957  0.64600908  0.56238357  0.48958333  0.42620705
  0.37103478  0.32300454  0.28119178  0.24479167  0.21310352  0.18551739
  0.16150227  0.14059589  0.12239583]
scales to test is [  1.           1.14869835   1.31950791   1.51571657   1.74110113   2.
   2.29739671   2.63901582   3.03143313   3.48220225   4.           4.59479342
   5.27803164   6.06286627   6.96440451   8.           9.18958684
  10.55606329  12.12573253  13.92880901  16.        ]

Time taken to resize image is 94.285ms

/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/__init__.py:541: UserWarning: Theano flag device=gpu* (old gpu back-end) only support floatX=float32. You have floatX=float64. Use the new gpu back-end with device=cuda* for that value of floatX.
  warnings.warn(msg)

Using gpu device 0: GeForce GTX 1060 (CNMeM is disabled, cuDNN 5105)
Traceback (most recent call last):
  File "compute_detector.py", line 215, in <module>
    image, verbose=False)
  File "/home/yiran/LIFT/python-code/Utils/solvers.py", line 148, in TestImage
    myNet = CreateNetwork4Image(pathconf, param, image, verbose=verbose)
  File "/home/yiran/LIFT/python-code/Utils/solvers.py", line 138, in CreateNetwork4Image
    myNet.compileSpecific(verbose=verbose)  # Compile specific to runType
  File "/home/yiran/LIFT/python-code/Utils/networks/eccv_base.py", line 602, in compileSpecific
    deterministic=True)
  File "/usr/local/lib/python2.7/dist-packages/lasagne/layers/helper.py", line 191, in get_output
    all_outputs[layer] = layer.get_output_for(layer_inputs, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/lasagne/layers/conv.py", line 330, in get_output_for
    conved = self.convolve(input, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/lasagne/layers/dnn.py", line 505, in convolve
    conv_mode=conv_mode
  File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/dnn.py", line 1265, in dnn_conv3d
    img = gpu_contiguous(img)
  File "/usr/local/lib/python2.7/dist-packages/theano/gof/op.py", line 604, in __call__
    node = self.make_node(*inputs, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/basic_ops.py", line 3910, in make_node
    input = as_cuda_ndarray_variable(input)
  File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/basic_ops.py", line 46, in as_cuda_ndarray_variable
    return gpu_from_host(tensor_x)
  File "/usr/local/lib/python2.7/dist-packages/theano/gof/op.py", line 604, in __call__
    node = self.make_node(*inputs, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/basic_ops.py", line 132, in make_node
    dtype=x.dtype)()])
  File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/type.py", line 95, in __init__
    (self.__class__.__name__, dtype, name))
TypeError: CudaNdarrayType only supports dtype float32 for now. Tried using dtype float64 for variable None
Parameters

My os is ubuntu 14.04,my cuda is 8.0

I hope I can get help here!
Thanks

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.