tensorflow-metal on M1: runs for 16 minutes, then hangs

Yesterday I seemed to succeed installing components to run TensorFlow/Keras on my M1 MacBook Pro. I started with another recipe, but it was this one that seemed to work: “Getting Started with tensorflow-metal PluggableDevice” (Tensorflow Plugin - Metal - Apple Developer).


I was able to run a simple model training run (on MINST) which took about 2 minutes, and seemed to work fine.


This morning I modified a Jupyter notebook from my own project and launched a training run. I expected it to run about 17 hours. After 16 minutes and 45 seconds it just hung. I tried it again and got the same result. Exactly the same as near as I could tell. It was on epoch 2/100 and batch (sub-batch?) 2493/4000 of the training run. This evening I rebooted the laptop and tried again. Same result.


Most of this is new to me so it is easy to believe I made some mistake during the installation. But I don’t have much to go on. Any hints/suggestions would be appreciated.


MacBook Pro Apple Silicon

Posted on Jul 18, 2022 7:24 PM

Reply
Question marked as Top-ranking reply

Posted on Jul 21, 2022 12:29 PM

Ah, never mind. I confuse Developer Forums - Apple Community with Apple Developer Forums. The Tensorflow Plugin - Metal - Apple Developer doc points to a tensorflow-metal forum at the latter. There I found this unresolved bug report, of which mine seems to be a duplicate:


The new tensorflow-macos and tenso… | Apple Developer Forums



Similar questions

2 replies

Jul 21, 2022 11:05 AM in response to cwr

Pinging this again just in hopes of getting some kind of a hint.


I moved aside all my Conda environments and again carefully followed Tensorflow Plugin - Metal - Apple Developer.


And I still see exactly the same hang (epoch 2/100, batch 2493/4000). Worth noting that this same Jupyter notebook (except for from source/destination pathname settings) had worked fine using Google Colab.


(I'm running macOS Monterey 12.4 on a M1 Max MacBook Pro (16-inch, 2021))

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

tensorflow-metal on M1: runs for 16 minutes, then hangs

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.