Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zhousaYolo opened this issue Apr 5, 2020 · 3 comments

Comments

@zhousaYolo
Copy link

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 != []

@Waynepoo
Copy link

Waynepoo commented May 6, 2020

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

@BinZheng1-pp
Copy link

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

@lrjun6188
Copy link

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为空。但是,有没有哪位能解释下原因

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants