Sanster / pytorch-network-slimming

A package to make do Network Slimming a little easier
47 stars 10 forks source link

示例代码,保存的模型大小有点疑问 #2

Closed GeneralJing closed 3 years ago

GeneralJing commented 3 years ago

使用示例代码训练resnet18保存到output目录的模型大小86M,如下: -rw-rw-r-- 1 jing jing 86M 2月 11 06:26 epoch=119-train_loss=0.02-test_acc=0.905.ckpt -rw-rw-r-- 1 jing jing 86M 2月 10 09:43 epoch=69-train_loss=0.00-test_acc=0.902.ckpt -rw-rw-r-- 1 jing jing 81M 2月 10 10:05 events.out.tfevents.1612919576.image.105605.0 -rw-rw-r-- 1 jing jing 462 2月 10 10:05 events.out.tfevents.1612922725.image.105605.1 -rw-rw-r-- 1 jing jing 79M 2月 11 06:26 events.out.tfevents.1612992806.image.47582.0 -rw-rw-r-- 1 jing jing 462 2月 11 06:26 events.out.tfevents.1612996007.image.47582.1 -rw-rw-r-- 1 jing jing 450 2月 12 17:33 events.out.tfevents.1613122393.image.104338.0 -rw-rw-r-- 1 jing jing 450 2月 12 18:49 events.out.tfevents.1613126993.image.26640.0 -rw-rw-r-- 1 jing jing 450 2月 13 07:20 events.out.tfevents.1613172040.image.24783.0 -rw-rw-r-- 1 jing jing 86M 2月 11 06:26 last.ckpt -rw-rw-r-- 1 jing jing 115 2月 13 07:20 metric.json -rw-rw-r-- 1 jing jing 86M 2月 11 06:26 model_with_pruning_result.ckpt drwxrwxr-x 2 jing jing 4.0K 2月 11 07:16 pruned_0.75 在pruned_0.75文件夹下,得到模型大小11M。 -rw-rw-r-- 1 jing jing 11M 2月 10 10:15 epoch=24-train_loss=0.01-test_acc=0.932.ckpt -rw-rw-r-- 1 jing jing 11M 2月 11 06:47 epoch=49-train_loss=0.00-test_acc=0.935.ckpt -rw-rw-r-- 1 jing jing 58K 2月 10 10:15 events.out.tfevents.1612922728.image.105605.2 -rw-rw-r-- 1 jing jing 261K 2月 11 07:16 events.out.tfevents.1612996011.image.47582.2 -rw-rw-r-- 1 jing jing 462 2月 11 07:16 events.out.tfevents.1612998965.image.47582.3 -rw-rw-r-- 1 jing jing 11M 2月 11 07:16 last.ckpt -rw-rw-r-- 1 jing jing 116 2月 11 07:16 metric.json readme列表resnet18模型大小11M,剪枝后4.5或者3.5,这个地方是什么原因呢 看代码感觉是把模型保存到一起了,没有单独保存剪枝后模型吗

Sanster commented 3 years ago
GeneralJing commented 3 years ago

好的,我明天试一下,多谢反馈

GeneralJing commented 3 years ago

试了一下,然后保存出来的模型大小是5.3M,跟readme里面还是不一致,不知道是不是有问题

Sanster commented 3 years ago