Little fix for NetSpec: allow setting top blob names using string #3747

Merged
merged 1 commit into from Feb 29, 2016

Conversation

Projects
None yet
2 participants

Nerei commented Feb 29, 2016

Some top blob names (ex. in GoogleNet) contain symbols that can't be used in python variable name.

n = caffe.NetSpec()
n.conv1/7x7_s2 = L.Convolution(n.data, name='conv1/7x7_s2', ...) 

This patch allows the following:

n = caffe.NetSpec()
n['conv1/7x7_s2'] = L.Convolution(n.data, name='conv1/7x7_s2', ...) 

The patch is just a simple workaround that doesn't break original NetSpec style to specify top names

Owner

shelhamer commented Feb 29, 2016

Right, the dictionary style NetSpec is definitely useful in these cases and we've done this in side branches without trouble. Thanks for the patch!

@shelhamer shelhamer added a commit that referenced this pull request Feb 29, 2016

@shelhamer shelhamer Merge pull request #3747 from Nerei/master
[pycaffe] NetSpec: set tops by attribute or dictionary
e5315fe

@shelhamer shelhamer merged commit e5315fe into BVLC:master Feb 29, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@fxbit fxbit added a commit to Yodigram/caffe that referenced this pull request Sep 1, 2016

@shelhamer @fxbit shelhamer + fxbit Merge pull request #3747 from Nerei/master
[pycaffe] NetSpec: set tops by attribute or dictionary
94c7f93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment