PaddleDetection icon indicating copy to clipboard operation
PaddleDetection copied to clipboard

pp-picodet非结构化稀疏训练比正常训练得到的模型更大,速度更慢,这是怎么回事?

Open LMR2018 opened this issue 4 years ago • 4 comments

pp-picodet非结构化稀疏训练比正常训练得到的模型更大,速度更慢,这是怎么回事? 用下面命令正常训练得到的模型3.8M左右: python tools/train.py -c configs/picodet/picodet_s_320_coco.yml 正常量化训练得到的模型也是3.8M左右: python tools/train.py -c configs/picodet/picodet_s_320_coco.yml --slim_config configs/slim/quant/picodet_s_quant.yml 非结构化稀疏训练训练得到的模型是11M左右: python -m paddle.distributed.launch --log_dir=log_test --gpus 0,1 tools/train.py -c configs/picodet/pruner/picodet_s_320_coco_pruner.yml --slim_config configs/slim/prune/picodet_s_unstructured_prune_75.yml

为何非结构化稀疏训练得到的模型会变大,最终导出的模型也大,速度也更慢?都是比较他们的float32

LMR2018 avatar Jan 05 '22 03:01 LMR2018

您好,因为你您这边问题还需要更多信息才好判断,您看是否方便添加一下微信即时交流? 我的微信号是lilith_yy

lilith-zy avatar Jan 05 '22 11:01 lilith-zy

@LMR2018 这是因为非结构化稀疏保存了一些mask variable(基本每个op的weights都有对应一个mask),所以变大是正常的。(保存这些mask variable也是为了继续训练的方便)

我这边训练的中间结果(pdparams文件)也是11MB。经过export_model.py和opt转换后,可以看到体积显著减小到小于FP32模型。

minghaoBD avatar Jan 05 '22 11:01 minghaoBD

@LMR2018 另外,11MB对于s模型来说可能有点大,建议排查下是否稀疏的s模型。 我这边m模型的中间结果,pdparams文件大小为11MB。

minghaoBD avatar Jan 05 '22 11:01 minghaoBD

Since this issue has not been updated for more than three months, it will be closed, if it is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up. It is recommended to pull and try the latest code first. 由于该问题超过三个月未更新,将会被关闭,若问题未解决或有后续问题,请随时重新打开(建议先拉取最新代码进行尝试),我们会继续跟进。

paddle-bot-old avatar Apr 19 '22 07:04 paddle-bot-old