Update Weight Watcher in utils

This commit is contained in:
D-X-Y
2020-03-11 00:44:39 -07:00
parent 2964bda731
commit 1fcde3e8ac
5 changed files with 346 additions and 12 deletions

View File

@@ -0,0 +1,21 @@
import sys, time, random, argparse
from copy import deepcopy
import torchvision.models as models
from pathlib import Path
lib_dir = (Path(__file__).parent / '..' / '..' / 'lib').resolve()
if str(lib_dir) not in sys.path: sys.path.insert(0, str(lib_dir))
from utils import weight_watcher
def main():
model = models.vgg19_bn(pretrained=True)
_, summary = weight_watcher.analyze(model, alphas=False)
# print(summary)
for key, value in summary.items():
print('{:10s} : {:}'.format(key, value))
# import pdb; pdb.set_trace()
if __name__ == '__main__':
main()