0

First of all, I am not using MACOS. I am using linux. Heres the full details:

>>uname -a 
Linux <my_hostname> 5.10.0-kali3-amd64 #1 SMP Debian 5.10.13-1kali1 (2021-02-08) x86_64 GNU/Linux
>>python3 --version
Python 3.9.2
>>pip3 --version
pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)

(and yes, kali. I am more comfortable with it than any other distro)

I installed tensorflow as I would do with other packages. pip3 install tensorflow. It installed successfully, but when I import it, it says zsh: illegal hardware instruction and the program quits there.

Please comment if any additional info in needed. Thank you for your help.

psychoSherlock
  • 112
  • 1
  • 9
  • It means it installed binaries for the wrong architecture – stark Jun 25 '21 at 17:35
  • @stark how can I install the correct binaries? – psychoSherlock Jun 25 '21 at 17:44
  • Follow this blog for similar issue and try the some suggested workarounds mentioned from the thread https://stackoverflow.com/a/66052835/14290244 and also follow this thread https://forums.macrumors.com/threads/macos-10-15-catalina-on-unsupported-macs.2183772/page-426. –  Jul 07 '21 at 05:53

1 Answers1

0

There's the same problem occurred when i try to use tensorflow in MacOs with M2.

Even the problem you created at almost two years ago it still exist today and i hope what i found can help more people.

(What i found in Reddit)

Here is the solutions:

  • Create a virtual environment with Python 3.10

  • pip install tensorflow-aarch64

  • Pip install tensorflow-macos

Tensorflow is just already extending hand to other third party colloborators like ARM, Intel, AWS to maintain their repository based on the diversity and incoming growth/maintenance cost of the Framework .

https://blog.tensorflow.org/2022/09/announcing-tensorflow-official-build-collaborators.html

There is a plugin documentation from Tensorflow, Which other manufacturers can use to build their own custom Tensorflow package suitable to the hardwares they hardware provide.

https://www.tensorflow.org/install/gpu_plugins

Apple metal plugin is such a use case.

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

Direct ML plugin is from Microsoft

for Windows users.

https://learn.microsoft.com/en-us/windows/ai/directml/gpu-tensorflow-plugin