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

ValueError: Input contains NaN #33

Open
random-friendly-dude opened this issue May 2, 2020 · 0 comments
Open

ValueError: Input contains NaN #33

random-friendly-dude opened this issue May 2, 2020 · 0 comments

Comments

@random-friendly-dude
Copy link

random-friendly-dude commented May 2, 2020

Hello!

Thank you for providing this wonderful tool for study. I changed the second option into all for LINE (line 48 of GraphEmbedding/examples/line_wiki.py), and encountered the following error:

....
97/97 - 1s - loss: nan - first_order_loss: nan - second_order_loss: 0.0503
Epoch 48/50
97/97 - 1s - loss: nan - first_order_loss: nan - second_order_loss: 0.0480
Epoch 49/50
97/97 - 1s - loss: nan - first_order_loss: nan - second_order_loss: 0.0485
Epoch 50/50
97/97 - 1s - loss: nan - first_order_loss: nan - second_order_loss: 0.0472
Training classifier using 80.00% nodes...
Traceback (most recent call last):
  File "line_wiki.py", line 52, in <module>
    evaluate_embeddings(embeddings)
  File "line_wiki.py", line 19, in evaluate_embeddings
    clf.split_train_evaluate(X, Y, tr_frac)
  File "/export/d1/shuaiw/GraphEmbedding/env/lib/python3.6/site-packages/ge-0.0.0-py3.6.egg/ge/classify.py", line 66, in split_train_evaluate
  File "/export/d1/shuaiw/GraphEmbedding/env/lib/python3.6/site-packages/ge-0.0.0-py3.6.egg/ge/classify.py", line 34, in train
  File "/export/d1/shuaiw/GraphEmbedding/env/lib/python3.6/site-packages/scikit_learn-0.22.2.post1-py3.6-linux-x86_64.egg/sklearn/multiclass.py", line 239, in fit
    for i, column in enumerate(columns))
  File "/export/d1/shuaiw/GraphEmbedding/env/lib/python3.6/site-packages/joblib-0.13.0-py3.6.egg/joblib/parallel.py", line 917, in __call__
    if self.dispatch_one_batch(iterator):
  File "/export/d1/shuaiw/GraphEmbedding/env/lib/python3.6/site-packages/joblib-0.13.0-py3.6.egg/joblib/parallel.py", line 759, in dispatch_one_batch
    self._dispatch(tasks)
  File "/export/d1/shuaiw/GraphEmbedding/env/lib/python3.6/site-packages/joblib-0.13.0-py3.6.egg/joblib/parallel.py", line 716, in _dispatch
    job = self._backend.apply_async(batch, callback=cb)
  File "/export/d1/shuaiw/GraphEmbedding/env/lib/python3.6/site-packages/joblib-0.13.0-py3.6.egg/joblib/_parallel_backends.py", line 182, in apply_async
    result = ImmediateResult(func)
  File "/export/d1/shuaiw/GraphEmbedding/env/lib/python3.6/site-packages/joblib-0.13.0-py3.6.egg/joblib/_parallel_backends.py", line 549, in __init__
    self.results = batch()
  File "/export/d1/shuaiw/GraphEmbedding/env/lib/python3.6/site-packages/joblib-0.13.0-py3.6.egg/joblib/parallel.py", line 225, in __call__
    for func, args, kwargs in self.items]
  File "/export/d1/shuaiw/GraphEmbedding/env/lib/python3.6/site-packages/joblib-0.13.0-py3.6.egg/joblib/parallel.py", line 225, in <listcomp>
    for func, args, kwargs in self.items]
  File "/export/d1/shuaiw/GraphEmbedding/env/lib/python3.6/site-packages/scikit_learn-0.22.2.post1-py3.6-linux-x86_64.egg/sklearn/multiclass.py", line 79, in _fit_binary
    estimator.fit(X, y)
  File "/export/d1/shuaiw/GraphEmbedding/env/lib/python3.6/site-packages/scikit_learn-0.22.2.post1-py3.6-linux-x86_64.egg/sklearn/linear_model/_logistic.py", line 1527, in fit
    accept_large_sparse=solver != 'liblinear')
  File "/export/d1/shuaiw/GraphEmbedding/env/lib/python3.6/site-packages/scikit_learn-0.22.2.post1-py3.6-linux-x86_64.egg/sklearn/utils/validation.py", line 755, in check_X_y
    estimator=estimator)
  File "/export/d1/shuaiw/GraphEmbedding/env/lib/python3.6/site-packages/scikit_learn-0.22.2.post1-py3.6-linux-x86_64.egg/sklearn/utils/validation.py", line 578, in check_array
    allow_nan=force_all_finite == 'allow-nan')
  File "/export/d1/shuaiw/GraphEmbedding/env/lib/python3.6/site-packages/scikit_learn-0.22.2.post1-py3.6-linux-x86_64.egg/sklearn/utils/validation.py", line 60, in _assert_all_finite
    msg_dtype if msg_dtype is not None else X.dtype)
ValueError: Input contains NaN, infinity or a value too large for dtype('float64').

Could anyone take a look and see if that can be fixed? Thank you very much!

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

1 participant