hanxf / matchnet Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 2-Clause "Simplified" License
License: BSD 2-Clause "Simplified" License
In the classifier_net.pbtxt
, the output dimension of FC layer is 1024. However, I want to test other dimensions and evaluate matchnet, which requires retraining the network using the original training prototxt file. Could you provide it? Thanks
Hi,
I am trying to re-write the network architecture in Keras. Please help me to review the following network architecture. The network contain two-different image types(i-e: the images taken from the camera (cam_input) and its corresponding CAD model image (cad_image)).
import os
import itertools
import numpy as np
from PIL import Image
from keras import backend as K
from keras.models import Model, Sequential
import matplotlib.pyplot as plt
from keras.optimizers import Adam
from sklearn.utils import shuffle
from keras.callbacks import TensorBoard
from keras.layers.merge import concatenate
from sklearn.metrics import confusion_matrix
from keras.layers import Input, Lambda, Dense, Flatten, Reshape, Conv2D, MaxPool2D
# input image size and channels
img_width, img_height, channels = 64, 64, 3
cam_input = Input(shape=(img_width,img_height,channels))
cad_input = Input(shape=(img_width,img_height,channels))
def feature_net(input_data):
conv0 = Conv2D(24, kernel_size=7, strides=(1,1), padding = 'SAME', activation='relu')(input_data)
pool0 = MaxPool2D((3, 3), strides=(2, 2), padding = 'SAME')(conv0)
conv1 = Conv2D(64, kernel_size=5, strides=(1,1), padding = 'SAME', activation='relu')(pool0)
pool1 = MaxPool2D((3, 3), strides=(2, 2), padding = 'SAME')(conv1)
conv2 = Conv2D(96, kernel_size=3, strides=(1,1), padding = 'SAME', activation='relu')(pool1)
conv3 = Conv2D(96, kernel_size=3, strides=(1,1), padding = 'SAME', activation='relu')(conv2)
conv4 = Conv2D(64, kernel_size=3, strides=(1,1), padding = 'SAME', activation='relu')(conv3)
pool4 = MaxPool2D((3, 3), strides=(2, 2), padding = 'SAME')(conv4)
return Reshape([4096])(pool4)
cam_fv = feature_net(cam_input)
cad_fv = feature_net(cad_input)
merge = concatenate([cam_fv, cad_fv])
# Similarity network
fc1 = Dense(1024, activation='relu', name='fc1')(merge)
fc2 = Dense(1024, activation='relu', name='fc2')(fc1)
output = Dense(2, activation='softmax', name='fc3')(fc2)
matchnet = Model(inputs=[cam_input, cad_input], outputs=output)
print(matchnet.summary())
Hi, anyone use TF frame to realize the matchNet? Thanks.
@hanxf,
Thank you for releasing matchnet evaluation code
I would like to fine-tune or re-train matchnet how do I do that?
Do i train featureNet and metricNet separately. i.e. train featureNet -> computer feature -> train metricNet?
If you can release the training routine then it will be really helpful.
Thanks for providing the interesting work. Could you provide the pretained network with the bottleneck layer of dimensions 128, 256 and 512?
As suggested on the README.md, I want evaluate the liberty model on notredame's test set, so I selected 100k 3Dpointid from the info.txt. How it is built instead the "interest.txt" file and how many bmp images should I use?
It is also not very clear how the file "interest.txt" was generated: is it an output from an extraction SIFT descriptor on patches? Thanks to anyone who can help me!!
The value of loss stays high from beginning to end within training time
I’m sorry to disturb you again. For academic study, I planned to recurrent your experiment result. Thus I written the network file “matchnet_siamese.prototxt” and the solver file “matchnet_siamese_solver.prototxt”, according to the file you shared. However, limited by my ability, I just trained the network without pipelines you introduced.
But, when I supervised the output window, the value of loss stayed high, vibrating around 0.69, much higher than which I obtained when training other classifier network.
So I want to please you help me check where the error comes from.
Thanks for your reading.
How to train this model on my dataset???
I couldn't access any of the files specified in the README, have they been changed?
First thank for your sharing. As I installed caffe on Win8.1, I ran the matchnet on Win8.1 too. My run_eval.bat written below:
/**************************************************************/
set TRAIN_DATASET=liberty
set TEST_DATASET=notredame
set GPU_OPTIONS=--use_gpu --gpu_id=0
set MODEL_DIR=models
set MODEL_NAME=%TRAIN_DATASET%_r_0.01_m_0
set TEST_DB=data/leveldb/%TEST_DATASET%.leveldb
set TEST_PAIR=data/phototour/%TEST_DATASET%/m50_100000_100000_0.txt
set OUTPUT=tmp/predictions.txt
python evaluate_matchnet.py ^
%GPU_OPTIONS% ^
%MODEL_DIR%/feature_net.pbtxt ^
%MODEL_DIR%/%MODEL_NAME%.feature_net.pb ^
%MODEL_DIR%/classifier_net.pbtxt ^
%MODEL_DIR%/%MODEL_NAME%.classifier_net.pb ^
%TEST_DB% ^
%TEST_PAIR% ^
%OUTPUT%
Pause
/*************************************************************/
After the command window printed many lines in terms of Block<I,i+1024>, I had the result, Error rate at 95% recall: 4.48%.
However, at the last line, I also had the error as below:
/**_/
F1208 11:10:39.654945 40000 syncedmem.hpp:30] Check failed: error == cudaSuccess <11 vs. 0> invalid argument
*__Check failure stack trace: *_*
/********/
And the output file was not generated. As I haven’t recognize the code, I could not find the problem. Could you help me explain the phenomenon? Thanks.
Has anyone had any luck training the matchnet and get reasonable results? In my case loss stays around 0.69 the entire training time. Thanks in advance!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.