-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
how to develop new layers #684
Comments
Update: see wiki at https://github.com/BVLC/caffe/wiki/Development-Hints Here's roughly the process I follow.
Since this is a many step process, I thought it worth recording here. I would welcome improvements to Caffe that make the layer adding process less involved. |
@longjon Thank you very much! :-D |
Many of the caffe devs use gdb, which is the usual choice for debugging C/C++ on Linux. |
@longjon Great! Thank you for all your help! I will try to learn gdb. |
@longjon we could put this steps in wiki? |
@bhack good idea, I've copied this at https://github.com/BVLC/caffe/wiki/Development-Hints. Edit as you see fit, it's a wiki. |
Closing -- documented in the wiki. Thanks Jon! |
Is it a must to write a test file ? |
@longjon Hi, longion |
Yes you need to write test for new layers. On Monday, December 29, 2014, Xeraph notifications@github.com wrote:
Sergio |
To elaborate a bit, of course you can do whatever you want with your own layers, but if you are doing anything nontrivial, gradient checking is crucial in ensuring a correct implementation. For PRs to Caffe, code needs to be sufficiently well-tested that we have confidence in its correctness. |
It is not a must, but safe to write a test file |
@longjon Hi,I followed your step and I have added my new layer,however,when I run caffe,I encountered an error:segmentation fault(core denied),would you please tell me what happend? |
@longjon good~ |
@wshenx You can use QtCreator + Cmake combination that I used in Linux. |
If I want to use GPU to train net, and I only write the cpp code, no .cu file, Is it OK? |
@artiit Then your Caffe only runs on CPU. By default, Caffe has a safe fall-back mechanism when you do not have GPU CUDA implementation. |
For future reference, the wiki page has apparently moved to https://github.com/BVLC/caffe/wiki/Development |
@williford I follow the step, but when I train the model, it says unknown layer type.. Do I have to remake caffe after I write the new layer? |
It takes so long to test all the layers. Is there a way to only test a specific layer? Update: I figured that out. First
to find out the name of test case for that layer. Then run
|
Here is the complete command I use to recompile caffe, recompile the tests, and run the tests of the layer I'm working on:
|
use Code::Blocks in linux,just like visual studio in windows,very easy |
@cuijianaaa I am trying to use code::block to speed up the testing but cannot manage to start a project with existing files, and I am not confident enough to work directly in the caffe home directory (caffe is finaly working and I would like to keep it that way :) ) |
Hi everyone. I'm new to caffe. I want to develop new layers but I don't know to start. I checked the development guide on http://caffe.berkeleyvision.org/development.html. But I still have no clues. Is there anyone who can give a small tutorial step by step on how to develop a new layer in caffe. That will be of great value. Thanks.
The text was updated successfully, but these errors were encountered: