From dd83de9ac2441489704545598602f32da1589724 Mon Sep 17 00:00:00 2001 From: Zhiwei Zhang Date: Fri, 5 Nov 2021 11:21:03 +0800 Subject: [PATCH 1/2] FIX export print type error --- nets/stdcnet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nets/stdcnet.py b/nets/stdcnet.py index 13ece7e..ea1f372 100644 --- a/nets/stdcnet.py +++ b/nets/stdcnet.py @@ -301,4 +301,4 @@ def forward_impl(self, x): x = torch.randn(1,3,224,224) y = model(x) torch.save(model.state_dict(), 'cat.pth') - print(y.size()) + print(f'Number of output nodes: {len(y)}') From 50f7c9fe5e62408a9cd88a17bf0b762dc0ca9c4d Mon Sep 17 00:00:00 2001 From: Zhiwei Zhang Date: Fri, 5 Nov 2021 11:29:00 +0800 Subject: [PATCH 2/2] print all nodes' sizes --- nets/stdcnet.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nets/stdcnet.py b/nets/stdcnet.py index ea1f372..b797dcc 100644 --- a/nets/stdcnet.py +++ b/nets/stdcnet.py @@ -302,3 +302,4 @@ def forward_impl(self, x): y = model(x) torch.save(model.state_dict(), 'cat.pth') print(f'Number of output nodes: {len(y)}') + print('\n'.join([f'Output node {i}\'s size: {node.size()}' for i, node in enumerate(y)]))