YOLOv3-model-pruning icon indicating copy to clipboard operation
YOLOv3-model-pruning copied to clipboard

执行test_prune.py出错,为了节省时间,我只用了100个数据进行测试,结果出问题

Open zhousaYolo opened this issue 4 years ago • 3 comments

Detecting objects: 33%|█████████████████████▋ | 1/3 [00Detecting objects: 67%|███████████████████████████████████████████▎ Detecting objects: 100%|████████████████████████████████████████████████Detecting objects: 100%|█████████████████████████████████████████████████████████████████| 3/3 [00:08<00:00, 2.80s/it] Computing AP: 100%|██████████████████████████████████████████████████ ████████████████████████████| 1/1 [00:00<?, ?it/s] Threshold should be less than 1.0462. The corresponding prune ratio is 0.809. Channels with Gamma value less than 0.9731 are pruned! Detecting objects: 33%|█████████████████████▋ | 1/3 [00Detecting objects: 67%|███████████████████████████████████████████▎ Detecting objects: 100%|████████████████████████████████████████████████Detecting objects: 100%|█████████████████████████████████████████████████████████████████| 3/3 [00:07<00:00, 2.63s/it] Traceback (most recent call last): File "test_prune.py", line 78, in threshold = prune_and_eval(model, sorted_bn, percent) File "test_prune.py", line 69, in prune_and_eval mAP = eval_model(model_copy)[2].mean() File "test_prune.py", line 27, in nms_thres=0.5, img_size=model.img_size, batch_size=4) File "D:\PycharmProjects\YOLOv3-model-pruning-master\test.py", line 55, in evaluate assert sample_metrics != []

zhousaYolo avatar Apr 05 '20 06:04 zhousaYolo

我也遇到同样的问题,请问楼主解决了吗?

Waynepoo avatar May 06 '20 02:05 Waynepoo

我原来也报这个错。 把test_prune.py里的precent调小试试看。

BinZheng1-pp avatar Feb 07 '21 07:02 BinZheng1-pp

Detecting objects: 33%|█████████████████████▋ | 1/3 [00Detecting objects: 67%|███████████████████████████████████████████▎ Detecting objects: 100%|████████████████████████████████████████████████Detecting objects: 100%|█████████████████████████████████████████████████████████████████| 3/3 [00:08<00:00, 2.80s/it] Computing AP: 100%|██████████████████████████████████████████████████ ████████████████████████████| 1/1 [00:00<?, ?it/s] Threshold should be less than 1.0462. The corresponding prune ratio is 0.809. Channels with Gamma value less than 0.9731 are pruned! Detecting objects: 33%|█████████████████████▋ | 1/3 [00Detecting objects: 67%|███████████████████████████████████████████▎ Detecting objects: 100%|████████████████████████████████████████████████Detecting objects: 100%|█████████████████████████████████████████████████████████████████| 3/3 [00:07<00:00, 2.63s/it] Traceback (most recent call last): File "test_prune.py", line 78, in threshold = prune_and_eval(model, sorted_bn, percent) File "test_prune.py", line 69, in prune_and_eval mAP = eval_model(model_copy)[2].mean() File "test_prune.py", line 27, in nms_thres=0.5, img_size=model.img_size, batch_size=4) File "D:\PycharmProjects\YOLOv3-model-pruning-master\test.py", line 55, in evaluate assert sample_metrics != []

Detecting objects: 33%|█████████████████████▋ | 1/3 [00Detecting objects: 67%|███████████████████████████████████████████▎ Detecting objects: 100%|████████████████████████████████████████████████Detecting objects: 100%|█████████████████████████████████████████████████████████████████| 3/3 [00:08<00:00, 2.80s/it] Computing AP: 100%|██████████████████████████████████████████████████ ████████████████████████████| 1/1 [00:00<?, ?it/s] Threshold should be less than 1.0462. The corresponding prune ratio is 0.809. Channels with Gamma value less than 0.9731 are pruned! Detecting objects: 33%|█████████████████████▋ | 1/3 [00Detecting objects: 67%|███████████████████████████████████████████▎ Detecting objects: 100%|████████████████████████████████████████████████Detecting objects: 100%|█████████████████████████████████████████████████████████████████| 3/3 [00:07<00:00, 2.63s/it] Traceback (most recent call last): File "test_prune.py", line 78, in threshold = prune_and_eval(model, sorted_bn, percent) File "test_prune.py", line 69, in prune_and_eval mAP = eval_model(model_copy)[2].mean() File "test_prune.py", line 27, in nms_thres=0.5, img_size=model.img_size, batch_size=4) File "D:\PycharmProjects\YOLOv3-model-pruning-master\test.py", line 55, in evaluate assert sample_metrics != []

调试发现,outputs = model(imgs)的输出中outputs的结果为none。所以,导致sample_metrics为空。但是,有没有哪位能解释下原因

LiuRJun avatar Jun 08 '21 01:06 LiuRJun