Skip to content

TensorFlow is not working properly #457

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

Open
kemalkilicaslan opened this issue Jan 6, 2024 · 3 comments
Open

TensorFlow is not working properly #457

kemalkilicaslan opened this issue Jan 6, 2024 · 3 comments

Comments

@kemalkilicaslan
Copy link

Although I installed both pip install tensorflow and pip install tensorflow-cpu version 2.15.0 of TensorFlow with Python version 3.11.5 in Anaconda Navigator version 23.7.4 on my Apple MacBook M1 Pro 10 CPU 16 GPU device, I cannot use TensorFlow and its modules on my local computer. I am waiting for your help as soon as possible, thanks.

@ShakirKhurshid
Copy link

M1 has an ARM architecture so TensorFlow needs to be installed with compatibility for that architecture. You can check this forum and see if it helps.
Install tensorflow on M1.

@kemalkilicaslan
Copy link
Author

Unfortunately it didn't help me to solve the problem, I tried many but not all of the other versions but with no results.

@Krishna9588
Copy link

I think your issue is because of Apple Silicon (M1/M2) - Chip. Follow these steps and try to reinstall TensorFlow, if your issue is not resolved, pin me, and I will try to provide an alternative solution.

  1. Uninstall any existing TensorFlow versions:

    pip uninstall tensorflow tensorflow-cpu tensorflow-macos tensorflow-metal -y
  2. Install the correct TensorFlow version for macOS:

    pip install tensorflow-macos  
    pip install tensorflow-metal  
  3. Verify the installation: - In any test.py file

    import tensorflow as tf  
    print(tf.__version__)  
    print(tf.config.list_physical_devices('GPU'))  
  4. (If using Conda) Create a new environment:

    conda create --name tf_env python=3.11  
    conda activate tf_env  
    pip install tensorflow-macos tensorflow-metal  

Step - 2 will surely resolve your issue.
Thank you.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants