Closed sbbug closed 2 years ago
模型调教的原因 可以参考示例复现
你好,楼主,为何剪枝完map直接为0?
你好,请问你是使用楼主的剪枝代码及命令完成减枝的吗?
你好,楼主,为何剪枝完map直接为0?
你好,请问你是使用楼主的剪枝代码及命令完成减枝的吗?
是的,基本是楼主的代码
主的代码
我运行楼主的剪枝就会报错,你能帮我看看吗?vx:txy1292757414
主的代码
我运行楼主的剪枝就会报错,你能帮我看看吗?vx:txy1292757414
你可以把错误贴出来
主的代码
我运行楼主的剪枝就会报错,你能帮我看看吗?vx:txy1292757414
你可以把错误贴出来
Traceback (most recent call last):
File "slim_prune_yolov5s.py", line 355, in
主的代码
我运行楼主的剪枝就会报错,你能帮我看看吗?vx:txy1292757414
你可以把错误贴出来
Traceback (most recent call last): File "slim_prune_yolov5s.py", line 355, in origin_model_metric = eval_model(model) File "slim_prune_yolov5s.py", line 350, in eval_model = lambda model:test(model=model,cfg=opt.cfg, data=opt.data, batch_size=16, img_size=img_size) File "D:\Gitee\yolov5_prune-4\test.py", line 181, in test inf_out, train_out = model(imgs) # inference and training outputs File "C:\Users\TXY\anaconda3\envs\yolo_v5\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(*input, *kwargs) File "D:\Gitee\yolov5_prune-4\modelsori.py", line 293, in forward x = module(x, img_size) File "C:\Users\TXY\anaconda3\envs\yolo_v5\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(input, **kwargs) File "D:\Gitee\yolov5_prune-4\modelsori.py", line 178, in forward p = p.view(bs, self.na, self.nc + 5, self.ny, self.nx).permute(0, 1, 3, 4, 2).contiguous() # prediction RuntimeError: shape '[16, 3, 85, 40, 80]' is invalid for input of size 1075200
模型配置文件需要修改,classes 、filters
模型调教的原因 可以参考示例复现
楼主,你剪枝代码有点复杂,能不能精简一下,,
你好,楼主,为何剪枝完map直接为0?
根据你说的调整classes后成功剪枝,出现和你相同的问题,map为0,且进行下一步微调时
python prune_finetune.py --img 640 --batch 4 --epochs 5 --data data/myvoc.yaml --cfg ./cfg/prune_0.8_keep_0.01_yolov5s_v4.cfg --weights ./weights/best
.pt
报错
Traceback (most recent call last):
File "prune_finetune.py", line 532, in
你好,楼主,为何剪枝完map直接为0?
请问你解决剪枝的问题了吗?
如果是开源数据集,请提供下载路径,用来帮助修复bug
主的代码
我运行楼主的剪枝就会报错,你能帮我看看吗?vx:txy1292757414
你可以把错误贴出来
Traceback (most recent call last): File "slim_prune_yolov5s.py", line 355, in origin_model_metric = eval_model(model) File "slim_prune_yolov5s.py", line 350, in eval_model = lambda model:test(model=model,cfg=opt.cfg, data=opt.data, batch_size=16, img_size=img_size) File "D:\Gitee\yolov5_prune-4\test.py", line 181, in test inf_out, train_out = model(imgs) # inference and training outputs File "C:\Users\TXY\anaconda3\envs\yolo_v5\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(*input, *kwargs) File "D:\Gitee\yolov5_prune-4\modelsori.py", line 293, in forward x = module(x, img_size) File "C:\Users\TXY\anaconda3\envs\yolo_v5\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(input, **kwargs) File "D:\Gitee\yolov5_prune-4\modelsori.py", line 178, in forward p = p.view(bs, self.na, self.nc + 5, self.ny, self.nx).permute(0, 1, 3, 4, 2).contiguous() # prediction RuntimeError: shape '[16, 3, 85, 40, 80]' is invalid for input of size 1075200
模型配置文件需要修改,classes 、filters
你好,你们剪枝的时候--data xxxxx.data文件从何而来呢,yolov5网络训练的时候用的yaml文件呀
这个问题解决了吗?我的也是,而且会显示剪枝前的map也为0
更新了剪枝代码验证模型的函数,和原版保持一致
你好,楼主,为何剪枝完map直接为0?