xingdi-eric-yuan / named-entity-recognition

A simple NER model in C++
39 stars 45 forks source link

Segfault in save2txt #2

Closed obskein closed 9 years ago

obskein commented 9 years ago

I'm trying to debug the segfault now and AFAIK it's happening when data.ATD(i,j) is being written to pOut in the save2txt method in weights_IO.cc.

So;

Next I'm going to try and figure out if it's because data.ATD(i,j) is null or there's a problem trying to write the file. AFAIK the file isn't being created, so theres that...

obskein commented 9 years ago

Please update the docs to include that users should make a folder called "kernel" so that the program doesn't segfault when it's run for the first time.

xingdi-eric-yuan commented 9 years ago

Thanks Obskein! I have updated the code and added string tmpstr = "kernel"; mkdir(tmpstr.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); to create "kernel" folder automatically.