Skip to content

Conversation

Nerei
Copy link

@Nerei 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

@shelhamer
Copy link
Member

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 added a commit that referenced this pull request Feb 29, 2016
[pycaffe] NetSpec: set tops by attribute or dictionary
@shelhamer shelhamer merged commit e5315fe into BVLC:master Feb 29, 2016
fxbit pushed a commit to Yodigram/caffe that referenced this pull request Sep 1, 2016
[pycaffe] NetSpec: set tops by attribute or dictionary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants