vbalnt / tfeat

TFeat descriptor models for BMVC 2016 paper "Learning local feature descriptors with triplets and shallow convolutional neural networks"
MIT License
148 stars 45 forks source link

Weights in tensorflow format? #4

Closed ducha-aiki closed 7 years ago

ducha-aiki commented 7 years ago

Provided tensorflow variant is great, but it doesn`t work with t7 weights :(

edgarriba commented 7 years ago

@ducha-aiki tensorflow version doesn't converge at all. I suggest you to use Pytorch which replicates results. Then you could try to share weights.

ducha-aiki commented 7 years ago

@edgarriba thanks. I have tried to run pytorch "as is" from https://github.com/edgarriba/examples/tree/master/triplet
and it fails with error:

0it [00:00, ?it/s]Traceback (most recent call last): File "./main.py", line 392, in main() File "./main.py", line 288, in main train(train_loader, model, optimizer, epoch) File "./main.py", line 305, in train out_a, out_p, out_n = model(data_a), model(data_p), model(data_n) File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 206, in call result = self.forward(*input, kwargs) File "./main.py", line 223, in forward x = self.features(x) File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 206, in call result = self.forward(*input, *kwargs) File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/container.py", line 64, in forward input = module(input) File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 206, in call result = self.forward(input, kwargs) File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/conv.py", line 237, in forward self.padding, self.dilation, self.groups) File "/usr/local/lib/python2.7/dist-packages/torch/nn/functional.py", line 40, in conv2d return f(input, weight, bias) RuntimeError: CHECK_ARG(input->nDimension == output->nDimension) failed at torch/csrc/cudnn/Conv.cpp:275

ducha-aiki commented 7 years ago

@edgarriba I have sent two PR to make it works, please look at them