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

Issue with loading BERTopic model. 'NNDescent' object has no attribute '_bit_trees' #1933

Open
siyerp opened this issue Apr 17, 2024 · 3 comments

Comments

@siyerp
Copy link

siyerp commented Apr 17, 2024

The code:

from bertopic import BERTopic
model_path = "/path/to/bertopic/model"
model = BERTopic.load(model_path)

The error:
AttributeError: 'NNDescent' object has no attribute '_bit_trees'

The solution:

I downgraded my pynndescent from 0.5.12 to 0.5.11. That solved the problem, but just bringing this to your attention in case there's a change that needs to be made moving forward.

@MaartenGr
Copy link
Owner

Thank you for sharing! You might also be able to prevent this issue by installing the latest umap-learn which might have fixed this issue.

@lucijakrusic
Copy link

I'm having the same issue now, and neither downgrading the pynndescent nor installing umap-learn helped. Beforehand, I also had an issue with loading the model, for which I upgraded numba. Any suggestions? Thanks in advance!

@MaartenGr
Copy link
Owner

@lucijakrusic Not quite sure what the solve is here. I assume you are loading from a pickle, right? In that case, you will need to make sure that all versions of all dependencies are exactly the same as when you saved the model.

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