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 specification #2086
Conversation
longjon
added a commit
to longjon/caffe
that referenced
this pull request
Mar 10, 2015
|
|
longjon |
a638bc8
|
longjon
added a commit
to longjon/caffe
that referenced
this pull request
Mar 10, 2015
|
|
longjon |
1764a53
|
longjon
added a commit
to longjon/caffe
that referenced
this pull request
Mar 10, 2015
|
|
longjon |
8c7ce28
|
longjon
added in progress ES interface
labels
Mar 13, 2015
|
This should now support repeated I think that means you can now specify any |
This was referenced Mar 20, 2015
weiliu89
added a commit
to weiliu89/caffe
that referenced
this pull request
Apr 1, 2015
|
|
weiliu89 |
8eecdd5
|
muupan
commented
Apr 5, 2015
|
uncamel('HDF5Data') wrongly returns 'hd_f5_data'. |
muupan
commented
Apr 5, 2015
|
And uncamel('PReLU') wrongly returns 'p_relu'. I think 'HDF5Data' -> 'hdf5_data' is normal uncamelling but 'PReLU' -> 'prelu' is exceptional. Maybe we have to find some other way. |
|
@muupan The layers that break the rule could just be hardcoded in the "uncamel" function, e.g. with a dictionary. Something like this:
|
Shaunakde
commented
Apr 21, 2015
|
@longjon I am having an issue using this PR. Running the example: http://nbviewer.ipython.org/github/BVLC/caffe/blob/tutorial/examples/01-learning-lenet.ipynb gives me the following error:
Update I tried adding an import statement for caffe as well and the following happened:
causes this error:
Discussion: http://stackoverflow.com/questions/29774793/typeerror-python-class |
elleryrussell
added a commit
to elleryrussell/caffe
that referenced
this pull request
May 1, 2015
|
|
elleryrussell |
2dd61dc
|
escorciav
referenced
this pull request
in escorciav/mlml-cnn
May 26, 2015
Closed
Safe prototxt creation #1
escorciav
commented
May 26, 2015
|
Hi @Shaunakde , you safe me hours of reading code so I felt that I should help you (sorry if you already noticed that). You should use the comment of seanbell for your example. I guess that the reason is that Thank you longjon for this tool. I have spent hours debugging prototxt without noticing minor difference such as layers instead of layer. |
BlGene
commented on an outdated diff
Jun 9, 2015
| @@ -0,0 +1,54 @@ | ||
| +from caffe import layers as L, params as P, to_proto |
BlGene
Contributor
|
|
Hi, I've been using this PR for a few days and I have been able to write all the models I wanted to using it. I am very pleased with it and Ty for writing it. The PR mentions that it fillers, but I don't see how these can be accessed from python, was this omitted from the PR? I was wondering if there is an easy way to specify parameters for python layers, here a few ideas came to mind:
So for this I was wondering if there is an easier way. Also in case it was overlooked, its worthwhile looking at the Theano version of this, called Mariana. |
|
See also Lasagne on Theano. |
|
Getting ready to update this; here's list of TODOs: Cleanups and fixes before first mergeable version, which should be considered basically a "protobuf wrapper/generator":
Desiderata and future work to come after merge (PRs welcome!):
|
|
TODOs all done for now; marking this ready for review! @muupan @seanbell and others, @Shaunakde, note that we generally aren't able to provide support for PRs, especially in-progress ones. You're welcome to contribute to the development discussion, but otherwise please use caffe-users or other venues. @BlGene, see the tests for an example of specifying fillers. Parameters for Python layers are a different (though related) issue; see, e.g., #2001. |
longjon
added ready for review and removed in progress
labels
Jun 18, 2015
longjon
referenced
this pull request
Jun 18, 2015
Open
Improve/enhance Python net specification #2621
shelhamer
commented on an outdated diff
Jun 30, 2015
| + | ||
| +# helper function for common structures | ||
| + | ||
| +def conv_relu(bottom, ks, nout, stride=1, pad=0, group=1): | ||
| + conv = L.Convolution(bottom, kernel_size=ks, stride=stride, | ||
| + num_output=nout, pad=pad, group=group) | ||
| + return conv, L.ReLU(conv, in_place=True) | ||
| + | ||
| +def fc_relu(bottom, nout): | ||
| + fc = L.InnerProduct(bottom, num_output=nout) | ||
| + return fc, L.ReLU(fc, in_place=True) | ||
| + | ||
| +def max_pool(bottom, ks, stride=1): | ||
| + return L.Pooling(bottom, pool=P.Pooling.MAX, kernel_size=ks, stride=stride) | ||
| + | ||
| +def alexnet(lmdb, batch_size=256, include_acc=False): |
shelhamer
Owner
|
|
@longjon amended names and the |
shelhamer
added a commit
that referenced
this pull request
Jun 30, 2015
|
|
shelhamer |
1d6cac2
|
shelhamer
merged commit 1d6cac2
into
BVLC:master
Jun 30, 2015
1 check was pending
kjmonaghan
commented
Jul 16, 2015
|
Very helpful, thank you! How do I go about changing the decay_mult parameter? |
|
e.g.,
(untested, could be slightly wrong) |
twerdster
added a commit
to twerdster/caffe
that referenced
this pull request
Jul 19, 2015
|
|
longjon + twerdster |
c81b580
|
kashefy
referenced
this pull request
Jul 22, 2015
Closed
Fully Convolutional Semantic Segmentation error #2788
jmerkow
commented
Jul 30, 2015
|
Is it possible to specify dummy data with this? Based on caffenet.py, I would expect that it would be something like this: import caffe
from caffe import layers as L, params as P, to_proto
from caffe.proto import caffe_pb2
from __future__ import print_function
def gen_inputs():
data = L.DummyData(name="data",ntop=1,shape=dict(dim=[1,2,3]))
label = L.DummyData(name="label",ntop=1,shape=dict(dim=[1,2,3]))
return data,label
def caffenet(include_acc=False):
data,label=gen_inputs()
loss = L.SoftmaxWithLoss(data, label)
return to_proto(loss)
def make_net(output_dir='./',net_name='train'):
fname = os.path.join(output_dir,net_name+'.prototxt')
with open(fname, 'w') as f:
print(caffenet(), file=f)
make_net()this produces:
I've tried various other things using caffe_pb2 and caffe.params. def gen_inputs():
data = L.DummyData(name="data",ntop=1,dummy_data_param=dict(shape=dict(dim=[1,2,3])))
label = L.DummyData(name="label",ntop=1,dummy_data_param=dict(shape=dict(dim=[1,2,3])))
return data,labeldef gen_inputs():
data_shape = caffe_pb2.BlobShape()
data_shape.dim = [1,2,3]
data_param = caffe_pb2.DummyDataParameter()
data_param.shape = data_shape
data = L.DummyData(name="data",ntop=1,dummy_data_param=data_param)
label = L.DummyData(name="label",ntop=1,dummy_data_param=data_param)
return data,labelAny thoughts? |
|
Maybe this?: from __future__ import print_function
import caffe
from caffe import layers as L, params as P, to_proto
from caffe.proto import caffe_pb2
import os
def gen_inputs():
data = L.DummyData(name="data", ntop=1,dummy_data_param=dict(shape=[dict(dim=[1,2,3])]))
label = L.DummyData(name="label",ntop=1,dummy_data_param=dict(shape=[dict(dim=[1,2,3])]))
return data,label
def caffenet(include_acc=False):
data,label=gen_inputs()
loss = L.SoftmaxWithLoss(data, label)
return to_proto(loss)
def make_net(output_dir='./',net_name='train'):
fname = os.path.join(output_dir,net_name+'.prototxt')
with open(fname, 'w') as f:
print(caffenet(), file=f)
make_net()BR, Max |
|
@BlGene is right. If bad parameters are being silently ignored, however (in current |
jmerkow
commented
Jul 31, 2015
|
I can open it with this as a test case. It may be the name 'shape' which has meaning in some contexts? |
dfagnan
commented
Oct 9, 2015
|
@longjon Does this caffenet example get all the weight_filler and bias_fillers correct? I'm not able to easily see that the default weight_filler is somehow gaussian with std = 0.01 here. Is this true? |
longjon commentedMar 10, 2015
masteredition of #1733. Still rough, but should be usable by the intrepid.uncamelwhich broke acronym names (e.g., LRN) (thanks @sontran).