Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zsh: illegal hardware instruction python on python 3.10 Mac M1 #60569

Closed
Spartanzhao opened this issue May 11, 2023 · 11 comments
Closed

zsh: illegal hardware instruction python on python 3.10 Mac M1 #60569

Spartanzhao opened this issue May 11, 2023 · 11 comments
Assignees
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author subtype:macOS macOS Build/Installation issues TF 2.12 For issues related to Tensorflow 2.12 type:build/install Build and install issues

Comments

@Spartanzhao
Copy link

Spartanzhao commented May 11, 2023

Click to expand!

Issue Type

Build/Install

Have you reproduced the bug with TF nightly?

Yes

Source

source

Tensorflow Version

tf 2.12

Custom Code

Yes

OS Platform and Distribution

Mac M1

Mobile device

Mac M1

Python version

3.10

Bazel version

No response

GCC/Compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current Behaviour?

zsh: illegal hardware instruction python on python 3.10 Mac M1

Standalone code to reproduce the issue

It shows zsh: illegal hardware instruction python on python 3.10 Mac M1

Relevant log output

No response

@google-ml-butler google-ml-butler bot added the type:build/install Build and install issues label May 11, 2023
@Spartanzhao
Copy link
Author

I trying to install tensorflow by anaconda but only has 2.10 version, miniconda only as 2.11 version, pip install has bugs when import tensorflow: zsh: illegal hardware instruction python

@ameyb22
Copy link

ameyb22 commented May 11, 2023

I'd recommend installing tensorflow-deps using conda first and then installing other stuff using pip.

  1. conda install -c apple tensorflow-deps
  2. pip install -r requirements.txt

requirements.txt containing:

tensorflow-macos
tensorflow-metal
jupyter
# other packages
...

@Spartanzhao
Copy link
Author

I'd recommend installing tensorflow-deps using conda first and then installing other stuff using pip.

  1. conda install -c apple tensorflow-deps
  2. pip install -r requirements.txt

requirements.txt containing:

tensorflow-macos
tensorflow-metal
jupyter
# other packages
...

Thanks a lot, but where can I get requirements.txt? are there any official one?

@tilakrayal tilakrayal assigned tilakrayal and unassigned synandi May 12, 2023
@tilakrayal tilakrayal added TF 2.12 For issues related to Tensorflow 2.12 subtype:macOS macOS Build/Installation issues labels May 12, 2023
@tilakrayal
Copy link
Contributor

@Spartanzhao,
I tried to install Tensorflow on Apple M1 oand it is working, so you can install Tensorlflow by using one of the Conda, Miniconda or Miniforge approach. I tried to follow Get started with tensorflow-metal with Miniconda3 instructions.
Could you please try with arm64:Apple silicon

During the instructions Download Conda environment Miniconda3-latest-MacOSX-arm64.sh file will be downloaded and replace .sh file with miniconda.sh in command bash ~/miniconda.sh -b -p $HOME/miniconda as mentioned in first step

  1. Set up and please follow all steps from
  2. Install base TensorFlow as below:
bash ~/Miniconda3-latest-MacOSX-arm64.sh -b -p $HOME/miniconda
source ~/miniconda/bin/activate
conda install -c apple tensorflow-deps

Please use the command source ~/miniconda/bin/activate if you want to use/activate Miniconda environment

If you are specifically looking to go with Miniforge approach then please have a look at this link and for Miniconda-Article and also please refer Releases-Table

https://developer.apple.com/metal/tensorflow-plugin/ -- reference. Thank you!

@tilakrayal tilakrayal added the stat:awaiting response Status - Awaiting response from author label May 13, 2023
@Spartanzhao
Copy link
Author

Thank you, I think I had solved the issue!

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Status - Awaiting response from author label May 18, 2023
@tilakrayal
Copy link
Contributor

@Spartanzhao,
Glad the issue got resolved. Could you please feel free to move this issue to closed status. Thank you!

@tilakrayal tilakrayal added the stat:awaiting response Status - Awaiting response from author label May 18, 2023
@Spartanzhao
Copy link
Author

Okay!

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Status - Awaiting response from author label May 18, 2023
@tilakrayal tilakrayal added the stat:awaiting response Status - Awaiting response from author label May 18, 2023
@github-actions
Copy link

This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label May 26, 2023
@github-actions
Copy link

github-actions bot commented Jun 2, 2023

This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further.

@github-actions github-actions bot closed this as completed Jun 2, 2023
@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@rotimiakanni
Copy link

rotimiakanni commented Jan 8, 2024

Thank you, I think I had solved the issue!

@Spartanzhao How did you solve it?

I have a conda environment with tensorflow installed; but still getting zsh: illegal hardware instruction python desc_classifier.py when I import tensorflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author subtype:macOS macOS Build/Installation issues TF 2.12 For issues related to Tensorflow 2.12 type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

5 participants