apple / tensorflow_macos

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

System Locks Up and Logs Out User #176

Open MithrilTuxedo opened 3 years ago

MithrilTuxedo commented 3 years ago

When running a Keras example (https://keras.io/examples/generative/deep_dream/) using slightly larger input images for input and output (1200x800) my system locks up (cursor still moves but otherwise unresponsive) and eventually returns me to the login screen (some sort of crash, though I get no dialog) when tensorflow-macos is installed in my venv.

macOS Big Sur 11.2.1 iMac (Retina 5K, 27-inch, 2017) 3.4 GHz Quad-Core Intel Core i5 40 GB 2400 MHz DDR4 Radeon Pro 570 4 GB

Python 3.8.2 (default, Dec 21 2020, 15:06:04) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin

pip list

Package                 Version
----------------------- ---------
absl-py                 0.11.0
appnope                 0.1.2
astunparse              1.6.3
backcall                0.2.0
cached-property         1.5.2
cachetools              4.2.1
certifi                 2020.12.5
cffi                    1.14.5
chardet                 4.0.0
decorator               4.4.2
enum34                  1.1.10
flatbuffers             1.12
gast                    0.3.3
google-auth             1.26.1
google-auth-oauthlib    0.4.2
google-pasta            0.2.0
grpcio                  1.33.2
h5py                    2.10.0
idna                    2.10
ipython                 7.20.0
ipython-genutils        0.2.0
jedi                    0.18.0
Keras                   2.2.4
Keras-Applications      1.0.8
Keras-Preprocessing     1.1.2
Markdown                3.3.3
numpy                   1.19.5
oauthlib                3.1.0
opt-einsum              3.3.0
packaging               20.9
parso                   0.8.1
pexpect                 4.8.0
pickleshare             0.7.5
Pillow                  8.1.0
pip                     21.0.1
plaidml                 0.7.0
plaidml-keras           0.7.0
prompt-toolkit          3.0.16
protobuf                3.14.0
ptyprocess              0.7.0
pyasn1                  0.4.8
pyasn1-modules          0.2.8
pycparser               2.20
Pygments                2.7.4
pyparsing               2.4.7
PyYAML                  5.4.1
requests                2.25.1
requests-oauthlib       1.3.0
rsa                     4.7
scipy                   1.6.0
setuptools              53.0.0
six                     1.15.0
tensorboard             2.4.1
tensorboard-plugin-wit  1.8.0
tensorflow-addons-macos 0.1a2
tensorflow-estimator    2.4.0
tensorflow-macos        0.1a2
termcolor               1.1.0
traitlets               5.0.5
typeguard               2.11.1
typing-extensions       3.7.4.3
urllib3                 1.26.3
wcwidth                 0.2.5
Werkzeug                1.0.1
wheel                   0.36.2
wrapt                   1.12.1

It works:

pro55b commented 3 years ago

I have run this on an iMac mini with M1 processor and 16GB of RAM. I observe similar issues when using high resolution images (or changing the number of layers you let contribute). You can observe the memory allocated to Python with activity monitor, I noticed things started going wrong when approaching 12 GB allocated to Python. But if you stay within the memory limits it runs very fast!

MithrilTuxedo commented 3 years ago

If I adjust the image size down to 600x300 it locks up and logs out. If I adjust the image size down to 300x200 it uses <2GB of memory, but still locks up.

The last time I ran it (300x200) it actually restarted the computer and prompted to submit a system bug report when I logged in.