GithubHelp home page GithubHelp logo

node-fann's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-fann's Issues

Segmentation Fault in FANN When File Not Exist

I'm attempting to use fann.load to load a network, but there are times when that network my not exist. For that I've wrapped it in try/catch. Unfortunately, it appears that FANN is throwing a Segmentation Fault when the file doesn't exist, which Node doesn't catch.

Possible fix could be wrapping the fann function to capture the seg fault, and throwing a catchable error.

node 0.12.2: Module did not self-register.

I'm testing node-fann inside the aooj/fann docker image and it works well with the preinstalled node v0.10.26 and node-fann v1.0.0. But after I've updated node to the latest version 0.12.2 the following error occurred:

module.js:355
  Module._extensions[extension](this, filename);
                               ^
Error: Module did not self-register.
    at Error (native)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/node_modules/fann/index.js:1:80)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)

Header Include Path Issue

I am receiving the following error after calling $ npm install fann

[email protected] install /Users/tylerpayne/Desktop/Node/node_modules/fann
node-gyp rebuild

CXX(target) Release/obj.target/fann/src/fann-accs.o
In file included from ../src/fann-accs.cc:7:
In file included from ../src/node-fann.h:5:
../src/node-futil.h:7:10: fatal error: 'doublefann.h' file not found

include <doublefann.h>

     ^

1 error generated.
make: *** [Release/obj.target/fann/src/fann-accs.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/tylerpayne/Desktop/Node/node_modules/fann
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the fann package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls fann
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 14.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "--save" "fann"
npm ERR! cwd /Users/tylerpayne/Desktop/Node
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

I have FANN 2.2.0 and pkg-config and glib2 installed. I think I just need help including /usr/local/include in the GCC header search paths but have had no luck yet.

Error when sudo npm install fann

Hi,

I try to install this package but I get this error,
I already have installed glib2 and pkg-config
/////////////////////////////////////////////////////////////////////////////////////////////////////
/

[email protected] install /home/saman/node_modules/fann
node-gyp rebuild

gyp: Call to 'pkg-config --atleast-version=2.1.0 fann' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.11.0-26-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/saman/node_modules/fann
gyp ERR! node -v v4.4.2
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Linux 3.11.0-26-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "fann"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the fann package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs fann
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls fann
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/saman/FANN/npm-debug.log

/////////////////////////////////////////////////////////////////////////////////////////////////////

Thanks

Windows install

Hi,

Any help available to install on windows?

I have pkg-config installed and working, yet it fails.

Here is the console dump from npm install:

C:\xampp\htdocs\git\AIStock>npm install fann
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm http GET https://registry.npmjs.org/fann
npm http 304 https://registry.npmjs.org/fann

[email protected] install C:\xampp\htdocs\git\AIStock\node_modules\fann
node-gyp rebuild
C:\xampp\htdocs\git\AIStock\node_modules\fann>node "C:\Program Files\nodejs\node
_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebu
ild
gyp: Call to 'pkg-config --atleast-version=2.1.0 fann' returned exit status 1. w
hile trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_module
s\npm\node_modules\node-gyp\lib\configure.js:467:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:
12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modu
les\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\xampp\htdocs\git\AIStock\node_modules\fann
gyp ERR! node -v v0.10.22
gyp ERR! node-gyp -v v0.11.0
gyp ERR! not ok
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the fann package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls fann
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install" "fann"
npm ERR! cwd C:\xampp\htdocs\git\AIStock
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\xampp\htdocs\git\AIStock\npm-debug.log
npm ERR! not ok code 0

can't install - log attached

272 verbose stack Error: [email protected] install: node-gyp rebuild
272 verbose stack Exit status 1
272 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
272 verbose stack at emitTwo (events.js:106:13)
272 verbose stack at EventEmitter.emit (events.js:191:7)
272 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
272 verbose stack at emitTwo (events.js:106:13)
272 verbose stack at ChildProcess.emit (events.js:191:7)
272 verbose stack at maybeClose (internal/child_process.js:877:16)
272 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
273 verbose pkgid [email protected]
274 verbose cwd /Users/drowne/projects/nn_mastering
275 error Darwin 15.6.0
276 error argv "/usr/local/Cellar/node/6.6.0/bin/node" "/usr/local/bin/npm" "install" "fann"
277 error node v6.6.0
278 error npm v3.10.7
279 error code ELIFECYCLE
280 error [email protected] install: node-gyp rebuild
280 error Exit status 1
281 error Failed at the [email protected] install script 'node-gyp rebuild'.
281 error Make sure you have the latest version of node.js and npm installed.
281 error If you do, this is most likely a problem with the fann package,
281 error not with npm itself.
281 error Tell the author that this fails on your system:
281 error node-gyp rebuild
281 error You can get information on how to open an issue for this project with:
281 error npm bugs fann
281 error Or if that isn't available, you can get their info via:
281 error npm owner ls fann
281 error There is likely additional logging output above.
282 verbose exit [ 1, true ]

Momento on the Network

Having issues getting the load method to work on a serialized network (configuration).

When using the load, I am seeing a nodejs process abort.
After investigating, I can bypass the abort by editing the NNet::CreateFromFile method in the fan-create class impl.

Handle<Value> NNet::CreateFromFile(const Arguments &args)
{
    HandleScope scope;
    if (args.Length() != 1 || !args[0]->IsString())
        return VException("usage: new FANN.load(\"filename.nnet\")");

    char name[4096];
    String::Cast(*args[0])->WriteAscii(name, 0, 4096);
    // name[4095] = 0;  <=== comment this out!  

    FANN = fann_create_from_file(name); 

    return Undefined();
}

Beyond this, once the wrapped fann instance is available in Node, i get segment faults when attempting to interact with it:

PID 47970 received SIGSEGV for address: 0x11
0   segfault-handler-native.node        0x0000000100ca4b8b _ZL16segfault_handleriP9__siginfoPv + 191
1   libsystem_c.dylib                   0x00007fff8d92094a _sigtramp + 26
2   node                                0x000000010031e2f7 _ZN2v88internal9Assembler4movqENS0_8RegisterENS0_6HandleINS0_6ObjectEEENS0_9RelocInfo4ModeE + 199
3   fann.node                           0x0000000100caac8d _ZN4NNet3RunERKN2v89ArgumentsE + 283
4   node                                0x0000000100147038 _ZN2v88internalL21Builtin_HandleApiCallENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE + 456
5   ???                                 0x00002a6a8070618e 0x0 + 46636909748622
6   ???                                 0x00002a6a8078e71e 0x0 + 46636910307102

Has anyone on the author team attempted to read/write a network?

API doc?

Is there any API documentation? It's pretty hard to get all the parameters by looking through the FANN doc and the binding code.

Error on install node-fann on Linux Mint

sudo npm inpm http GET https://registry.npmjs.org/fann
npm http 304 https://registry.npmjs.org/fann

[email protected] install /home/mike/projects/node-fann-example/node_modules/fann
node-gyp rebuild

gyp: Call to 'pkg-config --atleast-version=2.1.0 fann' returned exit status 1.
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.11.0-12-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/mike/projects/node-fann-example/node_modules/fann
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the fann package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls fann
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.11.0-12-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "i"
npm ERR! cwd /home/mike/projects/node-fann-example
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/mike/projects/node-fann-example/npm-debug.log
npm ERR! not ok code 0

NPM Installation error on Debian

npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the fann package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild || (node-waf configure && node-waf clean && node-w
af build)

Build issue on MAC OS

Hi there! I've encountered an issue with installing your module. fann lib is installed via macports, and header files placed to /opt/local/include. It looks like that gyp isn't aware of it and reports about error:

$ npm install fann

> [email protected] install /whatever/node_modules/fann
> node-gyp rebuild

  CXX(target) Release/obj.target/fann/src/fann-accs.o
In file included from ../src/fann-accs.cc:7:
In file included from ../src/node-fann.h:5:
../src/node-futil.h:7:10: fatal error: 'doublefann.h' file not found
#include <doublefann.h>
         ^
1 error generated.
make: *** [Release/obj.target/fann/src/fann-accs.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/homedir/.nvm/v0.10.21/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 13.0.0
gyp ERR! command "node" "/homedir/.nvm/v0.10.21/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /whatever/node_modules/fann
gyp ERR! node -v v0.10.21
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
$ file /opt/local/include/doublefann.h
/opt/local/include/doublefann.h: ASCII c program text

Any ideas how to fix it?

License

It'd be nice to have a defined license file for the repo.

Failed at the [email protected] install script 'node-gyp rebuild'

Hi, i cant install node-fann

make: Entering directory '/home/yyy/xxx/node_modules/fann/build'
CXX(target) Release/obj.target/fann/src/fann-accs.o
In file included from ../src/node-futil.h:8:0,
from ../src/node-fann.h:5,
from ../src/fann-accs.cc:7:
../../nan/nan.h:261:25: error: redefinition of 'template v8::Local _NanEnsureLocal(v8::Local)'
NAN_INLINE v8::Local _NanEnsureLocal(v8::Local val) {
^
../../nan/nan.h:256:25: note: 'template v8::Local _NanEnsureLocal(v8::Handle)' previously declared here
NAN_INLINE v8::Local _NanEnsureLocal(v8::Handle val) {
^
../../nan/nan.h:473:20: error: variable or field 'NanAddGCEpilogueCallback' declared void
v8::Isolate::GCEpilogueCallback callback
^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.