Can not get new positive sample

231 篇文章 25 订阅
在机器学习中,设置正样本数量时,许多人误解了-numPos的含义。实际上,它遵循一个特定的数学公式:vec-file number >= (numPos + (numStages-1) * (1 – minHitRate) * numPos) + S。通过公式,给定vec-file number为5085,numStages为20,minHitRate为0.98,S(负样本数)为2177,计算得到numPos应小于等于2628.9,因此取2628作为正确的正样本数。
摘要由CSDN通过智能技术生成
Can not get new positive sample

很多人会卡在这里,我也被卡了一个下午,很多人以为这里的-numPos 就是你所谓的正样本的总数,那你就大错特错了。这里有个公式,我们需要通过这个来求解这个-numPos,过程如下:

  1. vec-file number >= (numPos + (numStages-1) * (1 – minHitRate) * numPos) + S

vec-file number  就是我们的正样本总数5085,numstages=20,minHitRate=0.98,S 表示负样本总数也就是等于2177,这样我们可以就差numPos<=2628.9,所以我们这里的numPos应该去2628,这样正确地输入格式应该是这样的:



http://bbs.csdn.net/topics/390388465

这是我在网上搜到的正解:
The problem is that your vec-file has exactly the same samples count that you passed in command line -numPos 979. Training application used all samples from the vec-file to train 0-stage and it can not get new positive samples for the next stage training because vec-file is over. The bug of traincascade is that it had assert() in such cases, but it has to throw an exception with error message for a user. It was fixed in r8913. -numPose is a samples count that is used to train each stage. Some already used samples can be filtered by each previous stage (ie recognized as background), but no more than (1 - minHitRate) * numPose on each stage. So vec-file has to contain >= (numPose + (numStages-1) * (1 - minHitRate) * numPose) + S, where S is a count of samples from vec-file that can be recognized as background right away. I hope it can help you to create vec-file of correct size and chose right numPos value.

It worked for me. I also had same problem, I was following the famous tutorial on HAAR training but wanted to try the newer training utility with -npos 7000 -nneg 2973

so i did following calcs:

vec-file has to contain >= (numPos + (numStages-1) * (1 - minHitRate) * numPos) + S

7000 >= (numPos + (20-1) * (1 - 0.999) * numPos) + 2973

(7000 - 2973)/(1 + 19*0.001) >= numPos

numPos <= 4027/1.019

numPos <= 3951 ~~ 3950

and used:

-npos 3950 -nneg 2973

It works.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值