Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Segmentation fault (core dumped) about PLDA #166

Closed
daidaiduoduo opened this issue Apr 24, 2022 · 6 comments
Closed

Segmentation fault (core dumped) about PLDA #166

daidaiduoduo opened this issue Apr 24, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@daidaiduoduo
Copy link

daidaiduoduo commented Apr 24, 2022

Hello~~
I'm trying to run PLDA. I found that when I set the value of latent_topics bigger than 1 (like 5), and then call .make_doc() function. It posts "Segmentation fault (core dumped)" bug.
When I set latent_topics==0 or 1, it's ok.
I think it is similar to issues 30 : #30

@bab2min bab2min added the bug Something isn't working label Apr 26, 2022
@bab2min
Copy link
Owner

bab2min commented Apr 26, 2022

Hi @daidaiduoduo,
Could you share the code reproducing your error?
It will be helpful to find a cause of the bug.
Thank you in advance!

@daidaiduoduo
Copy link
Author

daidaiduoduo commented Apr 26, 2022

@bab2min
Hello~
Thank you for your reply. I run the following, and it posts the bug

import sys
import tomotopy as tp
import numpy as np
import os
mdl = tp.PLDAModel(tw=tp.TermWeight.ONE, latent_topics=5)    
d = ['a','b']
l = ['c','d']
mdl.add_doc(d,l)
mdl.make_doc(d,l)

@bab2min
Copy link
Owner

bab2min commented Apr 27, 2022

@daidaiduoduo Thank you for sharing the code. I'll examine it!

@daidaiduoduo
Copy link
Author

@daidaiduoduo Thank you for sharing the code. I'll examine it!

Hello~ Have you checked?
Emm...so, is it the way I use the model?

@bab2min
Copy link
Owner

bab2min commented Jun 7, 2022

Hi @daidaiduoduo
Sorry for too late reply.
Obviously your code should work without any problems, but it has been found that there is a bug in tomotopy's make_doc() implementation.
You can avoid this bug by calling train() before make_doc() as like:

mdl = tp.PLDAModel(tw=tp.TermWeight.ONE, latent_topics=5)    
d = ['a','b']
l = ['c','d']
mdl.add_doc(d,l)
mdl.train(0) # the model is prepared at this point
mdl.make_doc(d,l)

@daidaiduoduo
Copy link
Author

Hi @daidaiduoduo Sorry for too late reply. Obviously your code should work without any problems, but it has been found that there is a bug in tomotopy's make_doc() implementation. You can avoid this bug by calling train() before make_doc() as like:

mdl = tp.PLDAModel(tw=tp.TermWeight.ONE, latent_topics=5)    
d = ['a','b']
l = ['c','d']
mdl.add_doc(d,l)
mdl.train(0) # the model is prepared at this point
mdl.make_doc(d,l)

@bab2min Thank you! It works!! 555

bab2min added a commit that referenced this issue Jul 17, 2022
@bab2min bab2min mentioned this issue Jul 17, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants