cvlab-epfl / LIFT

Code release for the ECCV 2016 paper
485 stars 168 forks source link

Different Weights but the Same Output Descriptors? #7

Closed 13331151 closed 7 years ago

13331151 commented 7 years ago

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.

huangh12 commented 7 years ago

I also encountered a problem which may be somewhat similar to yours. It's that I set the flat _LIFT_USE_THEANO=0 in the run.sh (which means theano will not work in the program, right?). However it seems the program received no error during the running process and produce a descriptor image named img1_kp.txt.jpg. I have no idea why it can work..

13331151 commented 7 years ago

_LIFT_USE_THEANO=0

According to the code, when you set the theano off, it'll use opencv the do the computing instead...

huangh12 commented 7 years ago

Hi Jack, thanks for your reply. Forgive that I am new to this. You said the opencv will be do the computing instead when _LIFT_USE_THEANO is set to 0. But... opencv is a library right? Can a library do the computation? What do you mean by saying opencv will do the computing? Could you be more specific since the comment of _LIFT_USE_THEANO=0 in run.sh says "Whether the use Theano when keypoint testing. CuDNN is required when turned on" . And the reason why I set _LIFT_USE_THEANO to 0 is because my GPU(capability is less than 3) doesn't support cuDNN. Thank you very much :-)

kmyi commented 7 years ago

Hi Guys,

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?

Did you figure out why? One guess is that you might have to restart the python interpreter, as the file might have been already loaded into memory and locked or something. It's weird that it happens. If you have figured out why, and it is the reason you closed the issue, can you write it here so that other people can also benefit from your experience? Thanks!

Forgive that I am new to this. You said the opencv will be do the computing instead when _LIFT_USE_THEANO is set to 0. But... opencv is a library right? Can a library do the computation? What do you mean by saying opencv will do the computing? Could you be more specific since the comment of _LIFT_USE_THEANO=0 in run.sh says "Whether the use Theano when keypoint testing. CuDNN is required when turned on" . And the reason why I set _LIFT_USE_THEANO to 0 is because my GPU(capability is less than 3) doesn't support cuDNN. Thank you very much :-)

With _LIFT_USE_THEANO=0, the keypoint detector part will operate without using theano. Instead, it will use the opencv library functions to do the convolutions manually, which may be faster, due to not having the need of compilation.

Cheers, Kwang

13331151 commented 7 years ago

Apologize for my late reply. Yes, my problem is solved. The model network finally loads is not the new-CNN3-picc-iter-56k.h5 but the model.h5 ... Actually the network loads both of these models, but the latter one overwrite the former one. And it works fine now...

kmyi commented 7 years ago

Apologize for my late reply. Yes, my problem is solved.

Awesome :-)

The model network finally loads is not the new-CNN3-picc-iter-56k.h5 but the model.h5 ... Actually the network loads both of these models, but the latter one overwrite the former one. And it works fine now...

Ah, yes. The first load is just to initialize the network- sorry that the config file is confusing. Much of it is relic from the past...

Cheers,