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.

numpy 1.12 on OS X with mkl produces incorrect answer for numpy.dot

See original GitHub issue

Running numpy.dot normally produces the expected answer:

$  python -c "import numpy ; f=numpy.ones(2,dtype=numpy.float32);print f.dot(f)"
2.0

If I import a PyQt5 module first, I get a different answer:

$  python -c "import PyQt5.QtWidgets ; import numpy ; f=numpy.ones(2,dtype=numpy.float32);print f.dot(f)"
0.0

Other folks appear to have found the issue here, with an implied implication of the Accelerate library being loaded first. I could not discover the resolution they used, and I would prefer one that did not require fixing python import order.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
njsmithcommented, Feb 8, 2017

I suppose one option would be to see if you can reproduce your problem with Anaconda’s numpy+MKL build and then file a bug report with them 😈

0reactions
rgommerscommented, Jul 16, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors in sdot for float32 arrays on OSX, due to MKL bug #9758
I've found a very strange bug. Under certain circumstances, a small number of the entries in the dot product of two 2D arrays...
Read more >
numpy.dot giving incorrect answer for large integers
I'm working on some linear algebra stuff, and simply can't figure out why numpy gives ...
Read more >
NumPy User Guide
It is a Python library that provides a multidi- mensional array object, various derived objects (such as masked arrays and matrices), and an ......
Read more >
Release Notes — NumPy v1.17 Manual
Starting in version 1.12.0, numpy incorrectly returned a negatively ... The NumPy 1.15.x OS X wheels released on PyPI no longer contain 32-bit...
Read more >
Release notes — NumPy v1.24 Manual
Faster version of np.isin and np.in1d for integer arrays · Faster comparison ... numpy.random.randint produced incorrect value when the range was 2**32 ...
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