apple / tensorflow_macos

TensorFlow for macOS 11.0+ accelerated using Apple's ML Compute framework.
Other
3.67k stars 308 forks source link

numpy package from this repo is broken #207

Open chumaroz opened 3 years ago

chumaroz commented 3 years ago

Reproducing code example:

import numpy as np
np.isnan(np.nan)

Error message:

the above code results in False. In other words, nan values are not recognized as nan.

NumPy/Python version information:

1.18.5 3.8.8 (default, Feb 26 2021, 09:10:27) [Clang 12.0.0 (clang-1200.0.32.29)]

hannesa2 commented 3 years ago

It works for me

(tensorflow_venv) ➜  city-simulator git:(master) ✗ python
Python 3.8.8 (default, Feb 26 2021, 09:10:27) 
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
np.isnan(np.nan)
>>> np.isnan(np.nan)
False
chumaroz commented 3 years ago

It works for me

(tensorflow_venv) ➜  city-simulator git:(master) ✗ python
Python 3.8.8 (default, Feb 26 2021, 09:10:27) 
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
np.isnan(np.nan)
>>> np.isnan(np.nan)
False

@hannesa2 Yes that just proves the bug exists. And that behaviour can cause multiple issues in dependent modules downstream...

MikeTuomas commented 3 years ago

Your example works for me with conda installation https://github.com/apple/tensorflow_macos/issues/153 .

numpy version 1.20.1

hannesa2 commented 3 years ago

This is my conda installation

image
StefanStsc commented 3 years ago

I can confirm that numpy is broken for me as well

np.version.version '1.18.5'

jeffreyrdcs commented 3 years ago

I can confirm that the numpy that comes with the script is broken. I can reproduce the above error. It also breaks the pandas.describe() and causes seg fault.