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

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

Merged
merged 1 commit into from
Feb 29, 2016

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