error in train casacde
Hi I am having an error saying "Train dataset for temp stage can not filled. Branch training terminated. Cascade Classifier can't be trained. check the used training parameters" when I am trying to do training. I used 50 positive and 100 negative images. I saw a similar question here . My bg.txt file is already in the form mentioned in that solution but still having the error.
my console output was as follows-
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\cv_traincascade\Debug>cv_traincascade.exe
-data test -vec positives.vec -bg infofile.txt -numPos 50 -numNeg 100 -numStages 20 -precalcValBufSize 1024
-precalcIdxBufSize 1024 -w 24 -h 24
PARAMETERS:
cascadeDirName: test
vecFileName: positives.vec
bgFileName: infofile.txt
numPos: 50
numNeg: 100
numStages: 20
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
stageType: BOOST
featureType: HAAR
sampleWidth: 24
sampleHeight: 24
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: BASIC
===== TRAINING 0-stage =====
<BEGIN
POS count : consumed 50 : 50
Train dataset for temp stage can not be filled. Branch training terminated.
Cascade classifier can't be trained. Check the used training parameters.
strong text Can you please say what is wrong in my command? any help will be appreciated. thank you.
my directory info- C:\Users\Administrator\Documents\Visual Studio 2010\Projects\cv_traincascade\Debug
cv_traincascade.exe
positives.vec
negative
infofile.txt
context of infofile is al follows-
negative/UMD_001.jpg
negative/UMD_002.jpg
negative/UMD_003.jpg
negative/UMD_004.jpg
negative/UMD_005.jpg
negative/UMD_006.jpg
negative/UMD_007.jpg
negative/UMD_008.jpg
negative/UMD_009.jpg
negative/UMD_010.jpg
...
Here is the zip file of the directory https://docs.google.com/file/d/0B90iLkzk5IUrbXI3dkRsZFdEVGc/edit?usp=sharing
Parameter which you passed is "preCalcValBufSize" while it should have been precalcValBufSize. Similarly in the case of "precalcIdxBufSize". Its a sad thing that the parameters are not checked by the program. Double check your bg file too.
Hi Prasanna, Thanks for your reply I changed this 2 parameters but still getting the error.
Wrong parameters are no problem, they are just skipped, leaving you with the initial values, which should give no problem. So what @Prasanna pointed out can't be your problem. Can you publish a part of your infofile.txt file. I have the impression that he doesn't succeed in getting negative images. Also how did you create your positives vec file, single image with rotation stuff? Or based on original images only?
Also if you have exactly 50 positive images, try changing it to 40, because you always use the 0.9*effective_number rule, just to make sure that he can still get new positives if needed.
Also did you check if you are using front slashes or double backslashes? On some systems, backslash is an escape character, which will lead to the impossibility to read the bg.txt file and recover images.
I have tried using front slahes, back shales, doubles slashes.. but for every cases it gives same error.
Ok can you create a zip file containing the folder structure and data? Let me see what goes wrong by testing it out. Place the link to your downloads here.
Also, it could be your system filename becomes to long or can't contain slashes. Create a folder test on your root drive, then copy all the data and see if error still occurs.
Wait a sec. I didn't point that out as a solution to the actual problem. My guess is to try passing paths with a " ./ " preceding it. So it should look like ./negative/UMD_001.jpg . Tell me if it works.
@Prasanna thanks for your reply I tried using "./" but it does not work.