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

How to fix "FloatingPointError: divide by zero encountered in true_divide" ? #1

Open
chenghancc opened this issue Mar 19, 2022 · 3 comments

Comments

@chenghancc
Copy link

When I use DBGAN model for Link prediction, the following error occurs:

Traceback (most recent call last):
File "C:/Users/Monarch/Desktop/DBGAN-master/DBGAN_link/run.py", line 14, in
runner.erun()
File "C:\Users\Monarch\Desktop\DBGAN-master\DBGAN_link\link_prediction.py", line 43, in erun
DPP.sample_exact_k_dpp(size=0)
File "D:\Users\Monarch\Anaconda3\envs\tf1\lib\site-packages\dppy\finite_dpps.py", line 506, in sample_exact_k_dpp
random_state=rng)
File "D:\Users\Monarch\Anaconda3\envs\tf1\lib\site-packages\dppy\finite_dpps.py", line 492, in sample_exact_k_dpp
self.L_eig_vals = self.K_eig_vals / (1.0 - self.K_eig_vals)
FloatingPointError: divide by zero encountered in true_divide

Process finished with exit code 1

How to solve this problem ?

@SsGood
Copy link
Owner

SsGood commented Mar 20, 2022

Plz check the dppy version is 0.2.0 or not. If the version of dppy is correct while the problem still appear, you could also achieve the k-dpp sampling by another package, pydpp.

@chenghancc
Copy link
Author

Plz check the dppy version is 0.2.0 or not. If the version of dppy is correct while the problem still appear, you could also achieve the k-dpp sampling by another package, pydpp.

Yes, the version of the dppy I use is 0.2.0. I will try pydpp. Thank you for your reply.

@chenghancc
Copy link
Author

Plz check the dppy version is 0.2.0 or not. If the version of dppy is correct while the problem still appear, you could also achieve the k-dpp sampling by another package, pydpp.

Yes, the version of the dppy I use is 0.2.0. I will try pydpp. Thank you for your reply.

When I change dppy to pydpp the code works, thanks a lot!

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

2 participants