What do you think about this test function which somehow has the ability of testing out the pruned model ?
[phung@archlinux SqueezeNet-Pruning]$ python finetune.py --run
/usr/lib/python3.7/site-packages/torchvision/transforms/transforms.py:187: UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead.
warnings.warn("The use of the transforms.Scale transform is deprecated, " +
pred = tensor([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0], device=‘cuda:0’)
pred = tensor([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0], device=‘cuda:0’)
pred = tensor([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0], device=‘cuda:0’)
pred = tensor([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0], device=‘cuda:0’)
pred = tensor([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0], device=‘cuda:0’)
pred = tensor([0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1], device=‘cuda:0’)
pred = tensor([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1], device=‘cuda:0’)
pred = tensor([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1], device=‘cuda:0’)
pred = tensor([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1], device=‘cuda:0’)
pred = tensor([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1], device=‘cuda:0’)
pred = tensor([1, 1, 1, 1], device=‘cuda:0’)
Avg time taken per image is(over 800 Images…) 0.0007848718762397766
[phung@archlinux SqueezeNet-Pruning]$ ls -al
total 3800
drwxrwxr-x 5 phung phung 4096 Dec 2 13:59 .
drwxrwxr-x 5 phung phung 4096 Nov 21 11:07 …
-rw-rw-r-- 1 phung phung 1696 Nov 21 11:02 dataset.py
-rw-rw-r-- 1 phung phung 9545 Dec 2 23:07 finetune.py
-rw-rw-r-- 1 phung phung 2560 Nov 21 15:05 flops.py
-rw-r–r-- 1 phung phung 50 Dec 2 13:59 .gitignore
-rw-r–r-- 1 phung phung 2929897 Nov 29 22:58 model
-rw-r–r-- 1 phung phung 892984 Dec 2 21:00 model_prunned
-rw-rw-r-- 1 phung phung 8518 Dec 2 00:37 prune.py
drwxrwxr-x 2 phung phung 4096 Dec 2 09:13 __pycache__
-rw-rw-r-- 1 phung phung 661 Nov 21 11:02 README.md
drwxrwxr-x 2 phung phung 4096 Nov 29 22:57 test
drwxrwxr-x 2 phung phung 4096 Nov 29 22:56 train
[phung@archlinux SqueezeNet-Pruning]$
By the way, I have uploaded the project to colab