question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LinAlgError Array must not contain infs or NaNs

See original GitHub issue

I’m having some weird behavior. In my local environment the same code works as expected, and in my prod environment throws this error:

LinAlgError Array must not contain infs or NaNs

This is because a matrix in prod has nans, but the same matrix in local is correct. So this makes me think that for some reason numpy is working differently in my prod environment.

I’m running python 2.7.6 using GCC 4.2.1 on osx in my local environment. And i’m running python 2.7.3 using GCC 4.6.3 on ubuntu 12.04 in my prod environment.

Does anyone know which may be the difference in the numpy behavior? Any help is appreciated!

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
dimirapetrovacommented, Jan 8, 2019

Hi, can you share what exactly did you use to fix the problem. I am having the same issue with using this: eig_vals, eig_vecs = np.linalg.eig(matx)

0reactions
agustinhallercommented, Feb 26, 2014

Changed BLAS library and worked. Although the variances are different with different BLAS libraries. Don’t know why this happens 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

"ValueError: array must not contain infs or NaNs" - Stack ...
I am aware of scikit-learn GitHub issue #2089, but since I use scikit-learn 0.16.1 (with Python 2.7.10 x64) this problem should be solved...
Read more >
numpy.linalg.LinAlgError: Array must not contain infs or NaNs ...
Hi All, I searched the following error but no solution so I posted it as a separate topic. Any suggestion? Thanks.
Read more >
Getting 'ValueError: array must not contain infs or NaNs' even ...
I'm getting this ValueError: array must not contain infs or NaNs even after I used np.nan_to_num(). As you can see in the code...
Read more >
As Function Inputs - ValueError: array must not contain infs or ...
I am trying to fit a series of parameter inputs to a function where the inputs are able to change over time (and...
Read more >
ValueError: array must not contain infs or NaNs_赵孝正的博客
ValueError : array must not contain infs or NaNs 上面代码计算的结果,存入数据中,因为计算结果可能为infs或者NaNs,所以抛出异常。
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found