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

Attempt at reconciling caffe-crfrnn with upstream caffe #6

Closed
mtourne opened this issue Oct 14, 2015 · 8 comments
Closed

Attempt at reconciling caffe-crfrnn with upstream caffe #6

mtourne opened this issue Oct 14, 2015 · 8 comments

Comments

@mtourne
Copy link

mtourne commented Oct 14, 2015

Mostly trying to compile this on a mac, with CPU_ONLY.
So I thought it would be easier to add the differences on top of the upstream caffe

Here is my fork https://github.com/mtourne/crfasrnn, where caffe is a submodule that points here :
https://github.com/mtourne/caffe/tree/crfasrnn
(this makes it a lot easier to see what diverges if caffe-crfrnn stems off from the actual caffe git).

Everything builds and the tests pass (including meanfield layer one), but import caffe in python will segfault.

Would you have any ideas so I can further this ?
Thank you

@bittnt
Copy link
Collaborator

bittnt commented Oct 14, 2015

@mtourne Thanks for this contribution. This is great.

Regarding to the problem, I think you'd better look into caffe python interface: (https://github.com/torrvision/crfasrnn/blob/master/caffe-crfrnn/python/caffe/_caffe.cpp), and (https://github.com/torrvision/crfasrnn/blob/master/caffe-crfrnn/python/caffe/segmenter.py).

Let us know if you have made any progress in this regards.

Best wishes.

@mtourne
Copy link
Author

mtourne commented Oct 14, 2015

I think it might work, since I'm getting the exact same problem with caffe itself. I believe it's a problem with my mac and not with the code.
You should try my version ?

@mtourne
Copy link
Author

mtourne commented Oct 14, 2015

Alright made some good progress, the python demo now breaks on

I1014 15:39:37.443373 2079081216 upgrade_proto.cpp:618] Attempting to upgrade input file specified using deprecated V1LayerParameter: TVG_CRFRNN_COCO_VOC.prototxt
F1014 15:39:37.445202 2079081216 upgrade_proto.cpp:921] Unknown V1LayerParameter layer type: 40

Seems like it's the crop layer that's not recognized. But I've definitely added it to the merged caffe.proto [1]. I think it has to do with with some deprecated layerparam.
Any new insights ?

[1] https://github.com/mtourne/caffe/blob/bbbe3e02c9f1e263b00b2c06dba8b76f1b1aa784/src/caffe/proto/caffe.proto#L1086

@mtourne
Copy link
Author

mtourne commented Oct 15, 2015

It works now!
Took about 13 second to process one image on a 2.2ghz core i7 - cpu only. Not bad!

I haven't tested the gpu portion of the code, nor the matlab integration (presumably broken).

Feel free to take this contribution, as it seem like it would be easier to keep it functioning in the future if it's based on upstream caffe.

@bittnt
Copy link
Collaborator

bittnt commented Oct 15, 2015

@mtourne Thanks a lot for this contribution.

@ultrai
Copy link

ultrai commented Apr 8, 2016

mtourne Thanks for the contribution. Could you please share notes (step by step) to merge the mean field layer with caffe master. So, it helps case of caffe future releases.

@mtourne
Copy link
Author

mtourne commented Apr 8, 2016

@ultrai Basically started with master's Caffe, and then manually added all the code required. Sometimes by diffing the files.
The problem is that upstream Caffe and this repo have no common ancestry (instead of using git's way of managing that it's been copied into a separate repo).
Can't really provide much more insight than this ..

The way you'd keep it in sync with upstream Caffe going forward is by fetching upstream Caffe, and rebasing the modification of this specific branch onto it (you can also use merging, but it's less clean that rebase in that case). This is a very common git operation to do, I recommend reading more git-related material about it.

bittnt added a commit that referenced this issue Jul 8, 2016
@sadeepj
Copy link
Collaborator

sadeepj commented Aug 10, 2017

This is fixed now.

@sadeepj sadeepj closed this as completed Aug 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants