How To Upgrade Your Tourism Business with An Effective Digital Marketing Strategy

Myanmar tourism industry become more competitive than before and many tourism businesses are trying to expand their market digitally. Everyone in the industry starts their digital journey. Most of…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Installing TensorFlow on Apple M1 Pro using pyenv

Recently my work MacBook (2017 MB Pro) refreshed to a newer 2021 MB Pro with an M1 Pro chip. I had been reading a lot about how much faster/better the M1 chips are for ML training so that was the first thing I thought of to do once I had set it up.

I would classify Python 3.10.x as my current “daily driver” version, but not all ML packages or modules support it so I find myself using 3.9.x mostly when it comes to my ML learning journey and pyenv makes managing multiple versions of Python so very easy.

While virtualenv provided isolated environments, pyenv provided isolated Python versions — this means that I can install TensorFlow once for a specific version of Python and have it be sharable so that I would not have to reinstall everything again if I had been using virtualenv instead.

List available version of Python that can be installed:

You will see that there is actually a version of Python from pyenv that already includes miniforge which makes things really simple for us because we do not have to worry about version compatibility. We will install the latest version available at the time of writing:

First create a directory and in it run:

With TensorFlow installed for this particular pyenv version, you can now use it simply by setting your local Python version to it in your new project directory.

For me, it ran at 7s/epoch (~14ms/step) with an average training time of 1m27s, which is fantastic! I also ran the same benchmark on my MB Air running TensorFlow 2.3 and it ran at 90s/epoch (~190ms/step) with an average training time just over 18m!!

How do your results compare? I would love to know how the M1 Ultra or the new M2 chip compares.

I hope that this will be the first of many Medium articles as I document and share my ML journey. Cheers!

Add a comment

Related posts:

5 Hurdles to Overcome When Switching to UX Design

Are you feeling stuck in your current career? Don’t worry, you’re not alone! Many people find themselves wanting to switch professions for various reasons like unmet expectations, shifting…

How to Deal with Clients

This article is a small brief on a talk that João Rodrigues — co-founder and CTO of The Loop Co and me have made in the past week, before moving our team to remote work. -By João Bernardo Parreira…

10 Best Email Marketing Tips To Boost Your Campaign In 2020

If the answer is yes, then you are in the right place. Make the most of your effort into an email marketing campaign by following these quick and easy rules: Out of all 10 email marketing tips that…