Home > other >  tensorflow crashes on Mac M1
tensorflow crashes on Mac M1

Time:12-16

I am trying to start using tensorflow on my M1 Mac. However, I only get the following message when I try to import tensorflow

Python 3.8.5 (v3.8.5:580fbb018f, Jul 20 2020, 12:11:27) 
[Clang 6.0 (clang-600.0.57)] on darwin
In [2]: import tensorflow as tf


Process finished with exit code 132 (interrupted by signal 4: SIGILL)

I have tried using tensorflow versions 2.7.0, 2.6.0 and 2.5.0 but all have the same problem.

CodePudding user response:

I don't believe that M1 support is merged into mainline TF yet. You need to pip install Apple's special forks and packages, including (but not only) the following.

tensorflow-macos
tensorflow-metal
tensorflow-deps
tensorflow-macos

The full instructions are here, and that's where I'd start.

https://developer.apple.com/metal/tensorflow-plugin/

CodePudding user response:

This is the only guide that worked for me and it worked on the first try. I cannot help you with your problem, but something might have gone wrong during your installation.

https://caffeinedev.medium.com/how-to-install-tensorflow-on-m1-mac-8e9b91d93706

  • Related