Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Python/net spec coordinate map and crop computation #3613
Conversation
longjon
added enhancement in progress Python
labels
Jan 30, 2016
|
By the way (this should become evident when tests are added): basic usage is like this: from caffe.coord_map import crop
from caffe import layers as L
data = L.Data(...)
...
output = L.Convolution(...)
cropped_output = crop(output, data) |
seanbell
and 2 others
commented on an outdated diff
Jan 30, 2016
| @@ -0,0 +1,95 @@ | ||
| +from __future__ import division | ||
| +import numpy as np | ||
| +from caffe import layers as L | ||
| + | ||
| +PASS_THROUGH_LAYERS = ['AbsVal', 'ReLU', 'PReLU', 'Dropout', 'LRN', 'Eltwise', | ||
| + 'BatchNorm', 'BNLL', 'Log', 'Exp', 'MVN', 'Power', 'Sigmoid', 'Split', | ||
| + 'TanH', 'Threshold'] | ||
| + | ||
| +def conv_params(fn): | ||
| + params = fn.params.get('convolution_param', fn.params) |
seanbell
Contributor
|
SvenTwo
commented
Feb 1, 2016
|
Does this replace the "crop" layer types used in some fully convolutional networks? How do you perform training of fully convolutional networks if there is no crop layer to bring the per-pixel labels and the network output into the same coordinate space? Will you have to do the cropping manually as a pre-processing step on the training data? This looks rather inefficient to me. |
ahundt
commented
Feb 23, 2016
|
@longjon will #3570 and #3613 together provide the functionality in https://github.com/longjon/caffe/? I created longjon#11 to keep things going until the requisite parts are done. Also, is this close to merging? Things seem to have stalled in both for a month or so. Apologies if this is the wrong place to post this. |
shelhamer
added the
ES
label
Feb 25, 2016
shelhamer
commented on an outdated diff
Feb 27, 2016
shelhamer
added the
focus
label
Feb 27, 2016
This was referenced Feb 27, 2016
ahundt
commented
Feb 29, 2016
|
@shelhamer thanks! Also are these two patches applied to master compatible with the exiting trained .caffemodel and .prototext of the version in https://github.com/longjon/caffe? |
ahundt
referenced
this pull request
Feb 29, 2016
Merged
Fixbug #3494 No to_python (by-value) converter found for C++ t… #3575
ahundt
commented
Feb 29, 2016
|
The answer to my prior question is that no From the model zoo:
printed output in python:
key lines of stack trace:
@shelhamer is this perhaps a bug in this pull request? |
|
@ahundt, no (unless @shelhamer has made updates I'm not aware of), existing prototxts are not compatible with these two PRs. They will probably run with |
BlGene
referenced
this pull request
in weiliu89/caffe
Mar 1, 2016
Open
Rebase to latest master branch #1
shelhamer
closed this
Mar 4, 2016
shelhamer
reopened this
Mar 4, 2016
shelhamer
removed in progress ES
labels
Mar 4, 2016
shelhamer
closed this
Mar 4, 2016
shelhamer
reopened this
Mar 4, 2016
shelhamer
added a commit
to shelhamer/caffe
that referenced
this pull request
Mar 4, 2016
|
|
shelhamer |
7135e3c
|
shelhamer
added a commit
that referenced
this pull request
Mar 5, 2016
|
|
shelhamer |
74cc497
|
shelhamer
merged commit 74cc497
into
BVLC:master
Mar 5, 2016
1 check passed
ahundt
commented
Mar 15, 2016
|
@shelhamer Is it possible to post new or updated pre-trained fcn-xx models using this code in the model zoo? |
This was referenced Apr 10, 2016
weiliu620
commented
Apr 19, 2016
•
|
Does pycaffe support 'Crop' layer? I run caffe.Net to load model net = caffe.Net(model_file, model_weights, caffe.TEST) and got error: F0419 10:14:49.936854 10131 layer_factory.hpp:77] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: Crop (known types: AbsVal, Accuracy, ArgMax, BNLL, Concat, ContrastiveLoss, Convolution, Data, Deconvolution, Dropout, DummyData, Eltwise, EuclideanLoss, Exp, Flatten, HDF5Data, HDF5Output, HingeLoss, Im2col, ImageData, InfogainLoss, InnerProduct, LRN, MVN, MemoryData, MultinomialLogisticLoss, Pooling, Power, ReLU, Sigmoid, SigmoidCrossEntropyLoss, Silence, Slice, Softmax, SoftmaxWithLoss, Split, TanH, Threshold, WindowData) (I used latest caffe master branch) |
shelhamer
deleted the
longjon:py-coord-map branch
Apr 19, 2016
fxbit
added a commit
to Yodigram/caffe
that referenced
this pull request
Sep 1, 2016
|
|
shelhamer + fxbit |
f58e39a
|
longjon commentedJan 30, 2016
This PR provides an updated version of #1975 (see also #1976; this is the new version described there). This is meant for use along with #3570 (new ND crop layer).
This version has several advantages over #1975, which make it a better candidate for merge.
NetandLayer, whereas the strategy employed by #1975 allowed for layers to interact in arbitrary ways that are difficult to reason about and make certain kinds of functionality difficult to implement. (This was the primary objection blocking the merge of #1975.) The alternate strategy used here is to perform the net-level analysis at net definition time (through pycaffe's net spec), and bake the results into the parameters of the net, through a much more straightforward (e.g.) crop layer (now #3570).Layerinterface remains unchanged; layers don't gain an extra method which may be obscure to some users.In addition, the functionality of this code is significantly expanded from that of #1975. In particular,
EltwiseorConvolutionwith multiple inputs/outputs) should now be supported.Like #1975, the coordinate maps computed with this code can be used for other purposes in addition to cropping.
The main disadvantage of this approach compared to #1975 is that the coordinate mapping formulae are kept apart from the definitions of their corresponding layers, which have to be manually kept in sync. Given that these formulae only come in a few basic forms, this seems like a reasonable approach for now.
This PR is not complete. The latest version of this code has just been written and has not been well-tested. Work still to be done:
coord_map_from_tois more awkward than it needs to be)coord_map_from_to)