Created
September 16, 2018 18:52
-
-
Save gongzhitaao/6ab6266dd6b20d08c4c0c7a5c65e87df to your computer and use it in GitHub Desktop.
Get output from intermediatelayers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import partial | |
def foo(self, inp, out, name=''): | |
log.debug('layer name {}'.format(name)) | |
log.debug('input size {}'.format(inp[0].size())) | |
log.debug('output size {}'.format(out[0].size())) | |
bar = partial(foo, name='Conv2d_1a_3x3') | |
env.net.Conv2d_1a_3x3.register_forward_hook(bar) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment