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

Drop error if a Caffe layer references an invalid bottom #576

Merged
merged 1 commit into from
Feb 12, 2016

Conversation

gheinrich
Copy link
Contributor

This should help address the case when a layer is added to manipulate e.g. the label blob. In that case the layer must include a directive like:

include {
phase: TRAIN
}

Otherwise Caffe will drop an error during inference.

A sanity check is added to DIGITS to catch these errors earlier in the process (i.e. before training).

@@ -1490,3 +1501,38 @@ def get_network_desc(self):
return text description of model
"""
return text_format.MessageToString(self.network)

def net_sanity_check(self, net, phase):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this a classmethod so it's easy to write tests for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, or perhaps a staticmethod since we're not making any reference to the class?
And I need to write tests too, thanks for reminding me :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah you're right - I meant staticmethod.

This should help address the case when a layer is added to manipulate e.g. the label blob. In that case the layer must include a directive like:

include {
 phase: TRAIN
}

Otherwise Caffe will drop an error during inference.

A sanity check is added to DIGITS to catch these errors earlier in the process (i.e. before training).
@gheinrich
Copy link
Contributor Author

I have updated the patch to make the new method static and I have added tests.

@lukeyeager
Copy link
Member

I have updated the patch to make the new method static and I have added tests.

Nice!

lukeyeager added a commit that referenced this pull request Feb 12, 2016
Drop error if a Caffe layer references an invalid bottom
@lukeyeager lukeyeager merged commit e538b51 into NVIDIA:master Feb 12, 2016
@gheinrich gheinrich deleted the dev/caffe-net-sanity-check branch April 14, 2016 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants