awslabs / dgl-lifesci

Python package for graph neural networks in chemistry and biology
Apache License 2.0
714 stars 147 forks source link

Problem while using the demo examples/property_prediction/csv_data_configuration/ #173

Closed dywlkji closed 2 years ago

dywlkji commented 2 years ago

Hi! I'm trying to using the hyperparameter search with Bayesian in the examples/property_prediction/csv_data_configuration/. Then getting common error as can be seen below:

~/anaconda3/envs/dgllife/lib/python3.6/site-packages/dgllife/utils/eval.py in score(y_true, y_pred)
    201         """
    202         def score(y_true, y_pred):
--> 203             return pearsonr(y_true.numpy(), y_pred.numpy())[0] ** 2
    204         return self.multilabel_score(score, reduction)
    205 

~/anaconda3/envs/dgllife/lib/python3.6/site-packages/scipy/stats/stats.py in pearsonr(x, y)
   3865     # scipy.linalg.norm(xm) does not overflow if xm is, for example,
   3866     # [-5e210, 5e210, 3e200, -3e200]
-> 3867     normxm = linalg.norm(xm)
   3868     normym = linalg.norm(ym)
   3869 

~/anaconda3/envs/dgllife/lib/python3.6/site-packages/scipy/linalg/misc.py in norm(a, ord, axis, keepdims, check_finite)
    138     # Differs from numpy only in non-finite handling and the use of blas.
    139     if check_finite:
--> 140         a = np.asarray_chkfinite(a)
    141     else:
    142         a = np.asarray(a)

~/anaconda3/envs/dgllife/lib/python3.6/site-packages/numpy/lib/function_base.py in asarray_chkfinite(a, dtype, order)
    484     if a.dtype.char in typecodes['AllFloat'] and not np.isfinite(a).all():
    485         raise ValueError(
--> 486             "array must not contain infs or NaNs")
    487     return a
    488 

ValueError: array must not contain infs or NaNs

I have checked the data(running on other project) and using the analysis.py , but the error still arises

mufeili commented 2 years ago

Could you share a minimal toy dataset and the command-lines you used for me to reproduce the error on my side?

dywlkji commented 2 years ago

May I have your email address

dywlkji commented 2 years ago

I have sent the dataset and script to your email : mufeili1996@gmail.com

dywlkji commented 2 years ago

Thanks a lot for your help. I have solved the problem