Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Layer exclusion naming convention applied to classification nets [DON'T MERGE YET] #605

Conversation

gheinrich
Copy link
Contributor

In case someone hits a problem like that mentioned in #601 for a classification network.
Once Caffe implements input layers and phase control from Python we should be able to remove those workarounds.

for layer in hidden_layers:
# don't add layers with names starting with "deploy_" to train/val network
if not layer.name.startswith('deploy_'):
train_val_network.layer.add().CopyFrom(layer)

Copy link
Member

Choose a reason for hiding this comment

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

In the generic path, I'm stripping the prefix from the final layer name:
https://github.com/NVIDIA/DIGITS/blob/v3.0.0/digits/model/tasks/caffe_train.py#L556

Can we do the same here?

@lukeyeager
Copy link
Member

I tried using this to integrate my Python accuracy layer (here), and got this error:

ERROR: Layer 'prob' references bottom 'accuracy' at the TEST stage however this blob is not included at that stage. Please consider using an include directive to limit the scope of this layer.

That's because this layer gets added to the deploy network:

layer {
  name: "prob"
  type: "Softmax"
  bottom: "accuracy"
  top: "prob"
}

The bottom should be ip2 instead of accuracy.

Looking at the code, I don't see a great way around this. I spent some time trying to find a programmatic solution to all this mess a while back (rough code here) and I gave up on it because there was simply no way to do it elegantly. I'd love to get BVLC/caffe#1245 integrated and update our default networks so that the networks can be fully, correctly specified without needing to do any magic behind the user's back.

In case someone hits a problem like that mentioned in NVIDIA#601 for a classification network.
Once Caffe implements input layers and phase control from Python we should be able to remove those workarounds.
@gheinrich gheinrich force-pushed the dev/classification-layer-exclusion-naming-convention branch from 51eafa5 to bbf0809 Compare February 29, 2016 18:12
@gheinrich
Copy link
Contributor Author

Updated to strip prefix but as @lukeyeager mentioned there is an issue with the helper code in DIGITS which adds a softmax layer to the deploy network.
Needs more work.

@gheinrich gheinrich changed the title Layer exclusion naming convention applied to classification nets Layer exclusion naming convention applied to classification nets [DON'T MERGE YET] Feb 29, 2016
@lukeyeager
Copy link
Member

Closed in favor of #623 (which has been closed in favor of #628 !).

@lukeyeager lukeyeager closed this Mar 11, 2016
@gheinrich gheinrich deleted the dev/classification-layer-exclusion-naming-convention branch April 14, 2016 13:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants