-
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
Matcaffe2 #501
Matcaffe2 #501
Conversation
@rbgirshick Could take a look a give me your opinion? |
This sounds like a very welcome update! I'll review the code this weekend On Fri, Jun 13, 2014 at 7:52 PM, Sergio Guadarrama <[email protected]
|
This PR includes #502 to allow compute gradients during |
[ i only skimmed the diff, so apologies if i misread it. ] i can't really comment on if caffe wants/needs a classdef style interface wrapper as i'm not really a matlab user. i guess the syntax/usage is nicer than the 'raw' mex-file interface? i guess there's also still really only one global net object behind the mex interface? i dunno if matlab has a way/idiom to actually have c++ objects (i.e. a way to set/get a void * + ownership/lifetime hooks) encapsulated inside matlab objects such that multiple net objects could be supported. while the current matlab interface (i.e. in dev) is octave compatible, this is not, since octave doesn't support classdef. while octave could still probably use the lower-level interface of the defined by matcaffe.cpp, any examples/code that used the classdef layer would become incompatible. so ...
there are costs/benefit of various levels of octave compatibility, but classdef support/usage is currently a thorny issue ... for the record, i think my status on the three questions above is: yes/yes/yes but, i'm expecting some no/no/no replies ... ;) |
Sorry, I still haven't gotten to reviewing this PR. I'm still swamped with I would like to rewrite matcaffe to remove The One Global Net. That should Regarding the three questions: I'm not personally concerned with Octave compatibility. I don't know any Ross On Wed, Jun 18, 2014 at 10:35 AM, moskewcz [email protected] wrote:
|
@moskewcz If you look at the code you would see that it is mostly syntactic sugar to have a clear interface and design, and a little bit of lazy evaluation. So any Octave user could easily write a OctaveCaffe.m file that simply encapsulate the calls to caffe.mex See https://github.com/BVLC/caffe/pull/501/files#diff-074ccb45539e7635cc6a871374289d7aR112 Regarding having multiple nets, I thought about it and have a design to maintain backward compatibility, but put it on hold until implementing the Solver which needs multiple nets. As @rbgirshick said, just by using a However I could include the multiple nets in this PR. |
@ross: okay, i see how int handles-to-nets could work. i was hoping for something that would allow for lifetime management and/or ownership transfer (i.e. like shared_ptr+boost::python, PyCapusle, or Lua's userdata). |
Think you have the wrong ross |
yeah, oops. sorry @ross, github noob error. thanks for dropping by? ;) On Wed, Jun 18, 2014 at 1:55 PM, Ross McFarland [email protected]
|
@@ -252,6 +252,7 @@ const vector<Blob<Dtype>*>& Net<Dtype>::ForwardPrefilled(Dtype* loss) { | |||
*loss += layer_loss; | |||
} | |||
} | |||
DLOG(INFO) << "loss: " << *loss; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change something you want merged or did you just add it for your own debugging? If the later, please remove from the PR.
@sguada here are some high level comments. More detailed comments are -- I think that matlab/caffe/*.m files should be prefixed with either -- It would be great to add some documentation to CaffeNet.m -- This might be for a separate PR, but it would be great to add unit tests On Wed, Jun 18, 2014 at 2:08 PM, moskewcz [email protected] wrote:
|
Suggestion #657 (comment) to check inputs and complain gracefully instead of crashing. |
A new release is brewing soon. Is there any hope of finishing this up so that matcaffe is on even footing with pycaffe? |
@jeffdonahue rebased and ready for review :) |
Was looking at this since I tend to use matcaffe pretty heavily. Thanks a lot for this!
|
end | ||
function res = save_net(self, model_file) | ||
assert(is_initialized(self)) | ||
res = caffe_safe('save_net', model_file); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think caffe_safe('save_net',...) shouldn't return anything, since the corresponding matcaffe function doesn't return anything.
Once @jeffdonahue's and @bharath272's comments are addressed let's squash this all and merge it. If we missed the summer of matcaffe 2 we should certainly have the fall. |
@sguada this is so close! |
@sguada @shelhamer Hi, Is there any way to extract the fc7,fc6 feature vectors from pretrained models using the current matcaffe in master? I see that the hack mentioned in #299 is no longer working with the current build. Could you suggest an alternative? |
New plan: @bharath272 and @s-gupta have volunteered to take the last steps to see Matcaffe 2 to completion. This'll be carried out by #1913. |
Inspired by PyCaffe, a new and completely renovated MatCaffe interface (although backward compatible).
Now there is class CaffeNet that handle all the interactions with caffe.
New Features:
net = CaffeNet.instance
gets a instance of caffe network using default imagenet_deploy and caffe_reference_modelnet = CaffeNet.instance(model_def_file, model_file)
gets an instance of caffe network using the parameters specified.net.phase = 'TEST'; net.set_phase_test; net.set_phase('TEST');
net.mode = 'GPU'; net.set_mode_gpu; net_set_mode('GPU');
net.device_id = 1;net.set_device(1);
conv1
.More examples about new features to follow.