Close Menu
    Trending
    • How This Man Grew His Beverage Side Hustle From $1k a Month to 7 Figures
    • Finding the right tool for the job: Visual Search for 1 Million+ Products | by Elliot Ford | Kingfisher-Technology | Jul, 2025
    • How Smart Entrepreneurs Turn Mid-Year Tax Reviews Into Long-Term Financial Wins
    • Become a Better Data Scientist with These Prompt Engineering Tips and Tricks
    • Meanwhile in Europe: How We Learned to Stop Worrying and Love the AI Angst | by Andreas Maier | Jul, 2025
    • Transform Complexity into Opportunity with Digital Engineering
    • OpenAI Is Fighting Back Against Meta Poaching AI Talent
    • Lessons Learned After 6.5 Years Of Machine Learning
    AIBS News
    • Home
    • Artificial Intelligence
    • Machine Learning
    • AI Technology
    • Data Science
    • More
      • Technology
      • Business
    AIBS News
    Home»Machine Learning»Installing TensorFlow 2.19 on Apple Silicon M3: A Step-by-Step Guide | by Dr.Saad Laouadi | Apr, 2025
    Machine Learning

    Installing TensorFlow 2.19 on Apple Silicon M3: A Step-by-Step Guide | by Dr.Saad Laouadi | Apr, 2025

    Team_AIBS NewsBy Team_AIBS NewsApril 7, 2025No Comments5 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    Engaged on deep studying initiatives, pc imaginative and prescient, sequential fashions, or equally computationally costly fashions? You’ve most likely felt annoyed and bored with ready whereas testing totally different deep studying approaches. Many people have been there!

    Underneath some circumstances, you want a laptop computer which you can carry with you. After wanting on-line or getting suggestions from associates or colleagues, you lastly determined to spend money on a Mac with an Apple Silicon chip. Fact be informed, this know-how brings outstanding efficiency for machine studying duties.

    That was simply step one, which results in the second problem: atmosphere setup. Belief me once I inform you it’s a headache. I’ve labored with Apple merchandise utilizing each older CPU architectures and the newer Apple Silicon, so I do know the hurdles firsthand.

    I made a decision to jot down this text to assist anybody who has struggled with organising TensorFlow with GPU help on Apple Silicon M collection (M3 in my case). Hopefully, this information will prevent a while and frustration in case you ever face this problem.

    Earlier than we start, guarantee you might have:

    • A Mac with Apple Silicon M3 chip
    • macOS Sonoma or newer (The set up on older variations is totally different)
    • Command Line Instruments (run xcode-select --install in Terminal)
    • Homebrew (optionally available however beneficial)

    We begin by putting in Miniforge utilizing Homebrew for a clear set up.

    brew set up --cask miniforge

    It’s worthwhile to initialize the device together with your shell to make the mamba command out there (mamba is like conda however a lot quicker).

    # Initialize Conda
    mamba init zsh # or bash, relying in your shell
    # Use this command to make the change everlasting
    supply ~/.zshrc # or supply ~/.bashrc

    Now, we’ll create an remoted atmosphere particularly for TensorFlow. This prevents bundle conflicts with different initiatives and makes troubleshooting simpler.

    We’re specifying Python 3.11 since, as of the time of writing this text, it’s the supported model for TensorFlow.

    # Create a brand new atmosphere for TensorFlow
    mamba create -n tf-gpu python=3.11

    This switches your terminal session to make use of the packages out of your new atmosphere. Discover how your immediate adjustments to indicate (tf-gpu) firstly, indicating the energetic atmosphere.

    mamba activate tf-gpu

    We’re utilizing python3 -m pip as a substitute of simply pip to make sure we’re utilizing the proper pip from the environment. This installs the bottom TensorFlow bundle that can detect your Apple {hardware}.

    python3 -m pip set up tensorflow

    The tensorflow-metal plugin allows TensorFlow to make the most of Apple’s Metallic framework, which provides you entry to the GPU cores in your M3 chip. With out this bundle, TensorFlow would solely use your CPU.

    python3 -m pip set up tensorflow-metal

    Let’s confirm every thing put in accurately. This command filters the record of put in packages to indicate solely these associated to TensorFlow and Keras (TensorFlow’s high-level API). This helps verify we’ve got all of the required parts.

    pip record | grep -E 'keras|tensorflow'

    If every thing is right, then you will notice one thing just like this:

    Discover the tensorflow-metal bundle within the record, which confirms you’ve efficiently arrange GPU acceleration to your M3 chip!

    Lastly, let’s verify if TensorFlow truly acknowledges your M3’s GPU. Run this straightforward Python script to see what {hardware} TensorFlow can entry.

    This can present you the model of TensorFlow put in and, extra importantly, whether or not it may possibly see your GPU. When you see a GPU listed within the output, congratulations! Your setup is prepared for accelerated machine studying.

    import tensorflow as tf
    # Verify out there gadgets
    print("TensorFlow model:", tf.__version__)
    print("Bodily gadgets:", tf.config.list_physical_devices())
    print("GPU gadgets:", tf.config.list_physical_devices('GPU'))

    Whenever you run this code, it is best to see output confirming that TensorFlow has detected each your CPU and GPU, simply as I did on my M3 Mac.

    The [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')] confirms TensorFlow can see our GPU.

    Let’s go one step additional and confirm that TensorFlow can truly carry out computations in your GPU.

    The next code will run a easy matrix multiplication on the GPU and make sure the operation was certainly GPU-accelerated:

    # Confirm GPU operation
    with tf.system('/GPU:0'):
    a = tf.fixed([[1.0, 2.0], [3.0, 4.0]])
    b = tf.fixed([[5.0, 6.0], [7.0, 8.0]])
    c = tf.matmul(a, b)
    print("Matrix multiplication outcome:", c)
    print("Executed on GPU:", c.system.endswith('GPU:0'))

    The output ought to present the results of the matrix multiplication and, importantly, verify that the operation was executed on the GPU with a “True” response.

    When you see outcomes just like the following screenshot, congratulations! You’ve efficiently arrange TensorFlow with GPU acceleration in your Apple Silicon M3.

    You’ve now efficiently arrange TensorFlow with GPU acceleration in your Apple Silicon M3 Mac. What was as soon as a headache is now a simple course of. Your M3 chip is able to deal with demanding deep studying duties with spectacular velocity and effectivity.

    Maintain your set up up to date with occasional pip set up --upgrade tensorflow tensorflow-metal to profit from the most recent optimizations.

    Look ahead to my upcoming article on putting in PyTorch for Apple Silicon M3 — one other highly effective framework price having in your machine studying toolkit.

    Blissful coaching!



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleElon Musk’s X to clamp down on parody accounts
    Next Article How Small Law Firms Can Compete with Bigger Firms Using Automation
    Team_AIBS News
    • Website

    Related Posts

    Machine Learning

    Finding the right tool for the job: Visual Search for 1 Million+ Products | by Elliot Ford | Kingfisher-Technology | Jul, 2025

    July 1, 2025
    Machine Learning

    Meanwhile in Europe: How We Learned to Stop Worrying and Love the AI Angst | by Andreas Maier | Jul, 2025

    July 1, 2025
    Machine Learning

    Handling Big Git Repos in AI Development | by Rajarshi Karmakar | Jul, 2025

    July 1, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    How This Man Grew His Beverage Side Hustle From $1k a Month to 7 Figures

    July 1, 2025

    I Tried Buying a Car Through Amazon: Here Are the Pros, Cons

    December 10, 2024

    Amazon and eBay to pay ‘fair share’ for e-waste recycling

    December 10, 2024

    Artificial Intelligence Concerns & Predictions For 2025

    December 10, 2024

    Barbara Corcoran: Entrepreneurs Must ‘Embrace Change’

    December 10, 2024
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    Most Popular

    Why You Should Not Replace Blanks with 0 in Power BI

    June 20, 2025

    Building a Chatbot with Gradio: A Practical Guide | by Daniel Aasa | Feb, 2025

    February 11, 2025

    Get This $200 MacBook Air Laptop

    June 28, 2025
    Our Picks

    How This Man Grew His Beverage Side Hustle From $1k a Month to 7 Figures

    July 1, 2025

    Finding the right tool for the job: Visual Search for 1 Million+ Products | by Elliot Ford | Kingfisher-Technology | Jul, 2025

    July 1, 2025

    How Smart Entrepreneurs Turn Mid-Year Tax Reviews Into Long-Term Financial Wins

    July 1, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2024 Aibsnews.comAll Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.