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

Segmentation faults for hmm_generate, hmm_viterbi and hmm_loglik #474

Closed
davudadiguezel opened this issue Nov 18, 2015 · 6 comments
Closed

Comments

@davudadiguezel
Copy link

Hi,
I am trying to run hmm_viterbi and get Segment faults. I run it like this:
./hmm_viterbi -i test.csv -m hmm_gmm_testout.xml -o viterbi_out_test.txt

gdb gives me this error message:
Program received signal SIGSEGV, Segmentation fault.
__GI___libc_free (mem=0x100000001) at malloc.c:2929
2929 malloc.c: No such file or directory.
(gdb) bt
#0 __GI___libc_free (mem=0x100000001) at malloc.c:2929
#1 0x00007ffff7b89aef in mlpack::util::SaveRestoreUtility::LoadParameter(arma::Mat&, std::string const&) () from /org/share/home/adigueze/mlpack-1.0.12/bin/lib/libmlpack.so.1
#2 0x00000000004100fc in void mlpack::hmm::LoadHMM<mlpack::gmm::GMM<mlpack::gmm::EMFit<mlpack::kmeans::KMeans<mlpack::metric::LMetric<2, false>, mlpack::kmeans::RandomPartition, mlpack::kmeans::MaxVarianceNewCluster>, mlpack::gmm::PositiveDefiniteConstraint> > >(mlpack::hmm::HMM<mlpack::gmm::GMM<mlpack::gmm::EMFit<mlpack::kmeans::KMeans<mlpack::metric::LMetric<2, false>, mlpack::kmeans::RandomPartition, mlpack::kmeans::MaxVarianceNewCluster>, mlpack::gmm::PositiveDefiniteConstraint> > >&, mlpack::util::SaveRestoreUtility&) ()
#3 0x000000000040b8a0 in main ()

But I don't understand it. Don't know which file is missing, because all files in the command above do exist. Hmm_generate and _viterbi give the same error.
Thanks for any help!
Greetings
Davud

@rcurtin
Copy link
Member

rcurtin commented Nov 18, 2015

Hi Davud,

I see you're using mlpack-1.0.12 here, which is a little old now. Is it possible for you to try the current git master branch? The load/save functionality has been rewritten, and I think this may solve your issue. If that's not possible, I can try to dig a bit deeper into what's going on here.

@davudadiguezel
Copy link
Author

Thanks, I will try.

@davudadiguezel
Copy link
Author

I just updated and now I get this:
./hmm_train -i test.csv -n 3 -l labels.csv -t gmm -g 1 -o hmm.xml
[DEBUG] Compiled with debugging symbols.
[FATAL] Parameter '--label_file' does not exist in this program.
terminate called after throwing an instance of 'std::runtime_error'
what(): fatal error; see Log::Fatal output
Aborted (core dumped)

But the paramater still exists in hmm_train or was it removed? when I do the same without labels I get the same error.

@davudadiguezel
Copy link
Author

I added in line 313 in hmm_train_main.cpp an 's' because I guess it should be labels_file and not label_file, right?
Now I get this error:
[FATAL] Unknown extension '' for HMM model file.
Do I have to give a hmm model? I pass a number of hidden states. So this shouldn't be needed, right?

@rcurtin
Copy link
Member

rcurtin commented Nov 18, 2015

Hi there Davud,

I'm sorry that you had these problems. I did a little debugging and committed a few changes (a435e75..713fa60) that should fix your issues. You were correct that there was a misspelling; label_file should have been labels_file. I went a bit further and ensured that hmm_viterbi and hmm_generate and hmm_loglik all work with an HMM generated by hmm_train, and in my trials it seems to work. So I think that if you update to the latest git master revision and recompile, you should not have any problems.

One note is that any HMM you trained earlier with hmm_train will not load right; there was a bug that prevented the initial state probabilities from being properly saved (fixed in 7bbe735).

Please, let me know if you have any more issues, and again, sorry for the inconvenience.

Thanks,

Ryan

@rcurtin rcurtin closed this as completed Nov 18, 2015
@rcurtin rcurtin added this to the mlpack 1.1.0 milestone Nov 18, 2015
@davudadiguezel
Copy link
Author

works like a charm! Thanks for the quick fix!
Greetings,
Davud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants