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

Silence layer deletes data during backprop #3151

Closed
cvondrick opened this issue Oct 5, 2015 · 3 comments
Closed

Silence layer deletes data during backprop #3151

cvondrick opened this issue Oct 5, 2015 · 3 comments

Comments

@cvondrick
Copy link

During Backward_* in the Slience layer, it performs the following operation when propagate_down[i] is set to true:

caffe_set(bottom[i]->count(), Dtype(0), bottom[i]->mutable_cpu_data());

and similarly for the GPU.

Usually this code will not run because the Silence layer does not generally need backprop. However, if you force the network to do backprop, this will have the consequence of overwriting the bottom data blob with all zeros.

I think the correct behavior is to set the bottom diff to 0:

caffe_set(bottom[i]->count(), Dtype(0), bottom[i]->mutable_cpu_diff());

Should this be changed?

Thanks!

@jeffdonahue
Copy link
Contributor

Thanks for reporting @cvondrick. You're right, this is a bug and should be fixed. In practice though I think propagate_down should always be set to false since SilenceLayer won't be on a path to a loss (unless manually overridden with propagate_down: true in the LayerParameter, which would be odd), so this probably isn't affecting anyone...

@cvondrick
Copy link
Author

I agree that is an odd case, but I think it can also be triggered by setting the entire network to do force_backward (which is how I found this bug).

@jeffdonahue
Copy link
Contributor

You're right, that would trigger it as well. I'll send a PR with the fix in a second. Thanks again!

jeffdonahue added a commit that referenced this issue Oct 5, 2015
acmiyaguchi pushed a commit to acmiyaguchi/caffe that referenced this issue Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants