Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 1-dim feature vector extracted from pre-trained model to train a new CNN #836

Closed
Kelvin-Zhong opened this issue Aug 1, 2014 · 3 comments
Labels

Comments

@Kelvin-Zhong
Copy link

I have saw some other similar issues, but none of them can help me solve this problem.
I have used python to put all the feature extracted from the pre-train model in the leveldb, and use it as the source to train a new network.

I extracted the output vector of fc6 of imagenet network, which is a 1-dim 4096 vector.
Each value of my leveldb is a datum.SerializedtoString().
and datum.channel = 1, datum.height = 4096, datum.width = 1, and I have set the datum.label.

However, when I use this leveldb as input to train network, the loss function doesn't decrease, so as the Test score #1, and the Test #0 is stuck...

What is the issue? Can anyone provide a simple example on how to use this 1-dim vector to create a right leveldb to train a new network???

Many thanks~~

@Yangqing
Copy link
Member

Yangqing commented Aug 2, 2014

Just checking - are you using datum.data or datum.float_data?

Also, loss not decreasing is usually because you are not setting SGD right - a wrong network, or wrong learning rates, etc. Check those (maybe with a grid search on hyperparameters) to find out.

@Kelvin-Zhong
Copy link
Author

Hi, Yangqing, I am using datum.float_data? Is it the reason that my training fails?
What's the difference between datum.data and datum.float_data?

@shelhamer
Copy link
Member

There is now an example for HDF5 data modeling for vector features that should help you double-check the mechanics of what you're doing: http://nbviewer.ipython.org/github/BVLC/caffe/blob/dev/examples/hdf5_classification.ipynb

Further than that it is likely a matter of tuning the training as Yangqing advised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants