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

Win 10, PHP 5.6/7 crashes @ fann_train_on_file with "CLI has stopped working" #26

Open
bfal opened this issue Jul 23, 2016 · 6 comments

Comments

@bfal
Copy link

bfal commented Jul 23, 2016

I've tried installing the FANN 1.1.1, 1.1.0, 1.0.7 under PHP versions 5.6 & 7. Running the simple_train.php it crashes consistently at fann_train_on_file. Reducing $max_epochs makes it crash faster, reports never show up. running the xor_train.exe, simple_test.php does not crash.

@bfal
Copy link
Author

bfal commented Jul 23, 2016

I installed php 5.3 and FANN 1.1.1. Sometimes it makes it through, most times it crashes the same.

@bfal
Copy link
Author

bfal commented Jul 25, 2016

It appears to be related to the $epochs_between_reports setting. Changing it to 1 cause a crash every time. 0 or a huge number (more than $max_epochs) cause no crash and it completes. At no point does it show a report.

@bukka
Copy link
Owner

bukka commented Aug 2, 2016

I'm not really a win user but if you would be able to produce backtrace, I could possibly see when it crashes and help more or ping someone else who could possibly help:

See https://bugs.php.net/bugs-generating-backtrace-win32.php how to get backtrace on win.

@bfal
Copy link
Author

bfal commented Aug 2, 2016

Thanks for the reply.

I believe I setup things correct but need a debug file for fandouble.dll? This is what I get:

Function Arg 1 Arg 2 Arg 3 Arg 4 Source
fanndouble!fann_destroy+3c 008326b8 0122cb38 01232d44 547d09d4
php_fann!get_module+7a 010c84e0 01110430 000001f4 0122cb38
php5ts!zend_hash_del_key_or_index+ac 00000000 00000000 00000000 00000000

Exception Information
FANNDOUBLE!FANN_DESTROY+3CWARNING - DebugDiag was not able to locate debug symbols for fanndouble.dll, so the information below may be incomplete.

In php__PID__15224__Date__08_02_2016__Time_06_33_05PM__391__Second_Chance_Exception_C0000005.dmp the assembly instruction at fanndouble!fann_destroy+3c in D:\test\fanndouble.dll has caused an access violation exception (0xC0000005) when trying to read from memory location 0x00000000 on thread 0

Module Information
Image Name: D:\test\fanndouble.dll Symbol Type: Export
Base address: 0x00905a4d Time Stamp: Mon Jan 23 10:05:47 2012
Checksum: 0x00000000 Comments:
COM DLL: False Company Name:
ISAPIExtension: False File Description:
ISAPIFilter: False File Version:
Managed DLL: False Internal Name:
VB DLL: False Legal Copyright:
Loaded Image Name: fanndouble.dll Legal Trademarks:
Mapped Image Name: Original filename:
Module name: fanndouble Private Build:
Single Threaded: False Product Name:
Module Size: 76.00 KBytes Product Version:
Symbol File Name: fanndouble.dll Special Build: &

@bukka
Copy link
Owner

bukka commented Aug 7, 2016

Sorry for the slightly late reply. Might be related to the compile fanndouble.dll.

@weltling If you have a little bit of spare time, would you be able to check this on win 10:

$num_input = 2;
$num_output = 1;
$num_layers = 3;
$num_neurons_hidden = 3;
$desired_error = 0.001;
$max_epochs = 500000;
$epochs_between_reports = 1;

$ann = fann_create_standard($num_layers, $num_input, $num_neurons_hidden, $num_output);

if ($ann) {
    fann_set_activation_function_hidden($ann, FANN_SIGMOID_SYMMETRIC);
    fann_set_activation_function_output($ann, FANN_SIGMOID_SYMMETRIC);

    $filename = dirname(__FILE__) . "/xor.data";
    if (fann_train_on_file($ann, $filename, $max_epochs, $epochs_between_reports, $desired_error))
        fann_save($ann, dirname(__FILE__) . "/xor_float.net");

    fann_destroy($ann);
}

if you can see any crash? I just tested and it works fine on Linux. Possibly if you have any other idea how to better debug it or what could be the cause, that would be great!

@weltling
Copy link
Contributor

@bukka you didn't link the file, so i took it ./examples/logic_gates/xor.data . With that on the current master, your snippet doesn't crash for me as well.

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

3 participants