fabio-jreis / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

Traininig Save on Windows 7 x64 crash #471

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Launch Training
2.Saving Training
3.

What is the expected output? What do you see instead?
Expected Output : saving training in yml files but i have a crash in saving 
files

What version of the product are you using? On what operating system?
javacv 0.7

Please provide any additional information below.

Original issue reported on code.google.com by CLoO...@gmail.com on 9 May 2014 at 5:36

Attachments:

GoogleCodeExporter commented 9 years ago
Please try again with JavaCV 0.8.

Original comment by samuel.a...@gmail.com on 9 May 2014 at 11:09

GoogleCodeExporter commented 9 years ago
Hi Samuel,

Thank you for your response ..
I have the some crash too with JavaCV 0.8.1 

Original comment by CLoO...@gmail.com on 12 May 2014 at 2:31

Attachments:

GoogleCodeExporter commented 9 years ago
PS:it's just not stable some times the training save pass without a crash ..

Original comment by CLoO...@gmail.com on 12 May 2014 at 2:48

GoogleCodeExporter commented 9 years ago
Could you provide some sample code and data to reproduce the issue? Thanks!

Original comment by samuel.a...@gmail.com on 14 May 2014 at 2:13

GoogleCodeExporter commented 9 years ago
Hi Samuel,

Here how training it's made by me :
br = new BufferedReader(new FileReader(data_file));
            while ((line = br.readLine()) != null) {
                String[] data = line.split(";");
                img = cvLoadImage(data[0]);
                //Mat img_ = imread(data[0], CV_LOAD_IMAGE_GRAYSCALE);
                dst_img = cropFace(img);
                if (dst_img != null) {
                    f = toTinyGray(dst_img, scale, false);
                    if (!f.isNull()) {
                        if (isDataExists(data, l.ordinal() + 1)) {
                            Mat m = new Mat(f);
                            LearningFaces.put(counter, m);
                            //labels[counter] = Integer
                            //    .parseInt(data[l.ordinal() + 1]);
                            labelsBuf.put(counter,Integer.parseInt(data[l.ordinal() + 1]));
                            float progress = (counter * 100) / length;
                            counter++;
                            updateLog("[ TRAINING ] "+l+" PROGRESS [ " + progress
                                    + "% ]");
                        }
                    } else
                        updateLog("Corrupt file : " + data[0]);
                    dst_img.release();
                    f.release();
                    img.release();
                } else
                    updateLog("Corrupt file : " + data[0]);
--------------------------------------------------------------------------------
--------------------------
and here the part where the crash it's produced :

  GenderFisherRecognizer.train(LearningFaces, labels_); 
  saveTraining(dest + "jRecFisherData" + l+ ".yml",GenderFisherRecognizer);

--------------------------------------------------------------------------------
--------------------------
saveTraining function :
  private void saveTraining(String f,FaceRecognizer Recognizer) {

            File binaryDataFile = new File(f);
            if (binaryDataFile.exists()) {
                    binaryDataFile.delete();
            }
            Recognizer.save(f);
    }

PS:i have always a random prediction results when i scan the some face normal i 
must have consistent results for the some face egal, if i scan it 100 times i 
must have the some result.(i will be grateful if you help me to resolve this 
issue Samuel).

Thanks.

Original comment by CLoO...@gmail.com on 14 May 2014 at 8:30

GoogleCodeExporter commented 9 years ago
You're calling release() on your images before LearningFaces.train(). Of course 
that is not going to work: Don't do that.

And please post your questions on the mailing list next if possible, thank you!

Original comment by samuel.a...@gmail.com on 16 May 2014 at 2:12

GoogleCodeExporter commented 9 years ago
PS: I use the some code for linux x86, x64 and macosx x64 and it's work OK
the problem is only in windows +7 x64 i think the problem is in memory 
managemant with in MatVector or the train function , i have idea  to vc2012 so 
to change native dll 
from msvcp100.dll and msvcr100.dll to msvcp120.dll and msvcr120.dll but i don't 
now how to implement it with JavaCPP 0.8.1

Thanks.

Original comment by CLoO...@gmail.com on 16 May 2014 at 4:07

GoogleCodeExporter commented 9 years ago
Hi Thank you  for your response,

I delete all release functions from my code and i have the some crash 

Sorry, where is the mailing list ?

Thanks.

Original comment by CLoO...@gmail.com on 16 May 2014 at 4:13

GoogleCodeExporter commented 9 years ago
The mailing list is here:
http://groups.google.com/group/javacv/

In any case, you should try with JavaCV 0.8. Please post any questions you have 
on the mailing list! thanks

Original comment by samuel.a...@gmail.com on 25 May 2014 at 9:27