Code for testing various M1 Chip benchmarks with TensorFlow.

Overview

M1, M1 Pro, M1 Max Machine Learning Speed Test Comparison

This repo contains some sample code to benchmark the new M1 MacBooks (M1 Pro and M1 Max) against various other pieces of hardware.

It also has steps below to setup your M1, M1 Pro and M1 Max (steps should also for work Intel) Mac to run the code.

Who is this repo for?

You: have a new M1, M1 Pro, M1 Max machine and would like to get started doing machine learning and data science on it.

This repo: teaches you how to install the most common machine learning and data science packages (software) on your machine and make sure they run using sample code.

Machine Learning Experiments Conducted

All experiments were run with the same code. For Apple devices, TensorFlow environments were created with the steps below.

Notebook Number Experiment
00 TinyVGG model trained on CIFAR10 dataset with TensorFlow code.
01 EfficientNetB0 Feature Extractor on Food101 dataset with TensorFlow code.
02 RandomForestClassifier from Scikit-Learn trained with random search cross-validation on California Housing dataset.

Results

See the results directory.

Steps (how to test your M1 machine)

  1. Create an environment and install dependencies (see below)
  2. Clone this repo
  3. Run various notebooks (results come at the end of the notebooks)

How to setup a TensorFlow environment on M1, M1 Pro, M1 Max using Miniforge (shorter version)

If you're experienced with making environments and using the command line, follow this version. If not, see the longer version below.

  1. Download and install Homebrew from https://brew.sh. Follow the steps it prompts you to go through after installation.
  2. Download Miniforge3 (Conda installer) for macOS arm64 chips (M1, M1 Pro, M1 Max).
  3. Install Miniforge3 into home directory.
chmod +x ~/Downloads/Miniforge3-MacOSX-arm64.sh
sh ~/Downloads/Miniforge3-MacOSX-arm64.sh
source ~/miniforge3/bin/activate
  1. Restart terminal.
  2. Create a directory to setup TensorFlow environment.
mkdir tensorflow-test
cd tensorflow-test
  1. Make and activate Conda environment. Note: Python 3.8 is the most stable for using the following setup.
conda create --prefix ./env python=3.8
conda activate ./env
  1. Install TensorFlow dependencies from Apple Conda channel.
conda install -c apple tensorflow-deps
  1. Install base TensorFlow (Apple's fork of TensorFlow is called tensorflow-macos).
python -m pip install tensorflow-macos
  1. Install Apple's tensorflow-metal to leverage Apple Metal (Apple's GPU framework) for M1, M1 Pro, M1 Max GPU acceleration.
python -m pip install tensorflow-metal
  1. (Optional) Install TensorFlow Datasets to run benchmarks included in this repo.
python -m pip install tensorflow-datasets
  1. Install common data science packages.
conda install jupyter pandas numpy matplotlib scikit-learn
  1. Start Jupyter Notebook.
jupyter notebook
  1. Import dependencies and check TensorFlow version/GPU access.
import numpy as np
import pandas as pd
import sklearn
import tensorflow as tf
import matplotlib.pyplot as plt

# Check for TensorFlow GPU access
print(f"TensorFlow has access to the following devices:\n{tf.config.list_physical_devices()}")

# See TensorFlow version
print(f"TensorFlow version: {tf.__version__}")

If it all worked, you should see something like:

TensorFlow has access to the following devices:
[PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU'),
PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
TensorFlow version: 2.8.0

How to setup a TensorFlow environment on M1, M1 Pro, M1 Max using Miniforge (longer version)

If you're new to creating environments, using a new M1, M1 Pro, M1 Max machine and would like to get started running TensorFlow and other data science libraries, follow the below steps.

Note: You're going to see the term "package manager" a lot below. Think of it like this: a package manager is a piece of software that helps you install other pieces (packages) of software.

Installing package managers (Homebrew and Miniforge)

  1. Download and install Homebrew from https://brew.sh. Homebrew is a package manager that sets up a lot of useful things on your machine, including Command Line Tools for Xcode, you'll need this to run things like git. The command to install Homebrew will look something like:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

It will explain what it's doing and what you need to do as you go.

  1. Download the most compatible version of Miniforge (minimal installer for Conda specific to conda-forge, Conda is another package manager and conda-forge is a Conda channel) from GitHub.

If you're using an M1 variant Mac, it's "Miniforge3-MacOSX-arm64" <- click for direct download.

Clicking the link above will download a shell file called Miniforge3-MacOSX-arm64.sh to your Downloads folder (unless otherwise specified).

  1. Open Terminal.

  2. We've now got a shell file capable of installing Miniforge, but to do so we'll have to modify it's permissions to make it executable.

To do so, we'll run the command chmod -x FILE_NAME which stands for "change mode of FILE_NAME to -executable".

We'll then execute (run) the program using sh.

chmod +x ~/Downloads/Miniforge3-MacOSX-arm64.sh
sh ~/Downloads/Miniforge3-MacOSX-arm64.sh
  1. This should install Miniforge3 into your home directory (~/ stands for "Home" on Mac).

To check this, we can try to activate the (base) environment, we can do so using the source command.

source ~/miniforge3/bin/activate

If it worked, you should see something like the following in your terminal window.

(base) daniel@Daniels-MBP ~ %
  1. We've just installed some new software and for it to fully work, we'll need to restart terminal.

Creating a TensorFlow environment

Now we've got the package managers we need, it's time to install TensorFlow.

Let's setup a folder called tensorflow-test (you can call this anything you want) and install everything in there to make sure it's working.

Note: An environment is like a virtual room on your computer. For example, you use the kitchen in your house for cooking because it's got all the tools you need. It would be strange to have an oven in your bedroom. The same thing on your computer. If you're going to be working on specific software, you'll want it all in one place and not scattered everywhere else.

  1. Make a directory called tensorflow-test. This is the directory we're going to be storing our environment. And inside the environment will be the software tools we need to run TensorFlow.

We can do so with the mkdir command which stands for "make directory".

mkdir tensorflow-test
  1. Change into tensorflow-test. For the rest of the commands we'll be running them inside the directory tensorflow-test so we need to change into it.

We can do this with the cd command which stands for "change directory".

cd tensorflow-test
  1. Now we're inside the tensorflow-test directory, let's create a new Conda environment using the conda command (this command was installed when we installed Miniforge above).

We do so using conda create --prefix ./env which stands for "conda create an environment with the name file/path/to/this/folder/env". The . stands for "everything before".

For example, if I didn't use the ./env, my filepath looks like: /Users/daniel/tensorflow-test/env

conda create --prefix ./env
  1. Activate the environment. If conda created the environment correctly, you should be able to activate it using conda activate path/to/environment.

Short version:

conda activate ./env

Long version:

conda activate /Users/daniel/tensorflow-test/env

Note: It's important to activate your environment every time you'd like to work on projects that use the software you install into that environment. For example, you might have one environment for every different project you work on. And all of the different tools for that specific project are stored in its specific environment.

If activating your environment went correctly, your terminal window prompt should look something like:

(/Users/daniel/tensorflow-test/env) daniel@Daniels-MBP tensorflow-test %
  1. Now we've got a Conda environment setup, it's time to install the software we need.

Let's start by installing various TensorFlow dependencies (TensorFlow is a large piece of software and depends on many other pieces of software).

Rather than list these all out, Apple have setup a quick command so you can install almost everything TensorFlow needs in one line.

conda install -c apple tensorflow-deps

The above stands for "hey conda install all of the TensorFlow dependencies from the Apple Conda channel" (-c stands for channel).

If it worked, you should see a bunch of stuff being downloaded and installed for you.

  1. Now all of the TensorFlow dependencies have been installed, it's time install base TensorFlow.

Apple have created a fork (copy) of TensorFlow specifically for Apple Macs. It has all the features of TensorFlow with some extra functionality to make it work on Apple hardware.

This Apple fork of TensorFlow is called tensorflow-macos and is the version we'll be installing:

python -m pip install tensorflow-macos

Depending on your internet connection the above may take a few minutes since TensorFlow is quite a large piece of software.

  1. Now we've got base TensorFlow installed, it's time to install tensorflow-metal.

Why?

Machine learning models often benefit from GPU acceleration. And the M1, M1 Pro and M1 Max chips have quite powerful GPUs.

TensorFlow allows for automatic GPU acceleration if the right software is installed.

And Metal is Apple's framework for GPU computing.

So Apple have created a plugin for TensorFlow (also referred to as a TensorFlow PluggableDevice) called tensorflow-metal to run TensorFlow on Mac GPUs.

We can install it using:

python -m pip install tensorflow-metal

If the above works, we should now be able to leverage our Mac's GPU cores to speed up model training with TensorFlow.

  1. (Optional) Install TensorFlow Datasets. Doing the above is enough to run TensorFlow on your machine. But if you'd like to run the benchmarks included in this repo, you'll need TensorFlow Datasets.

TensorFlow Datasets provides a collection of common machine learning datasets to test out various machine learning code.

python -m pip install tensorflow-datasets
  1. Install common data science packages. If you'd like to run the benchmarks above or work on other various data science and machine learning projects, you're likely going to need Jupyter Notebooks, pandas for data manipulation, NumPy for numeric computing, matplotlib for plotting and Scikit-Learn for traditional machine learning algorithms and processing functions.

To install those in the current environment run:

conda install jupyter pandas numpy matplotlib scikit-learn
  1. Test it out. To see if everything worked, try starting a Jupyter Notebook and importing the installed packages.
# Start a Jupyter notebook
jupyter notebook

Once the notebook is started, in the first cell:

import numpy as np
import pandas as pd
import sklearn
import tensorflow as tf
import matplotlib.pyplot as plt

# Check for TensorFlow GPU access
print(tf.config.list_physical_devices())

# See TensorFlow version
print(tf.__version__)

If it all worked, you should see something like:

TensorFlow has access to the following devices:
[PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU'),
PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
TensorFlow version: 2.5.0
  1. To see if it really worked, try running one of the notebooks above end to end!

And then compare your results to the benchmarks above.

Comments
  • build error with h5py when running: python -m pip install tensorflow-macos

    build error with h5py when running: python -m pip install tensorflow-macos

    (/Users/billhuang/tensorflow-test/env) billhuang@Bills-iMac tensorflow-test % python -m pip install tensorflow-macos
    Defaulting to user installation because normal site-packages is not writeable Collecting tensorflow-macos Downloading tensorflow_macos-2.7.0-cp38-cp38-macosx_11_0_arm64.whl (179.0 MB) |████████████████████████████████| 179.0 MB 6.7 MB/s
    Collecting h5py>=2.9.0 Downloading h5py-3.6.0.tar.gz (384 kB) |████████████████████████████████| 384 kB 21.8 MB/s
    WARNING: Value for prefixed-purelib does not match. Please report this to https://github.com/pypa/pip/issues/10151 distutils: /private/var/folders/b1/_v80y9pj5x917c_phn4xsk000000gn/T/pip-build-env-5aixvc7e/normal/lib/python3.8/site-packages sysconfig: /Library/Python/3.8/site-packages WARNING: Value for prefixed-platlib does not match. Please report this to https://github.com/pypa/pip/issues/10151 distutils: /private/var/folders/b1/_v80y9pj5x917c_phn4xsk000000gn/T/pip-build-env-5aixvc7e/normal/lib/python3.8/site-packages sysconfig: /Library/Python/3.8/site-packages WARNING: Additional context: user = False home = None root = None prefix = '/private/var/folders/b1/_v80y9pj5x917c_phn4xsk000000gn/T/pip-build-env-5aixvc7e/normal' WARNING: Value for prefixed-purelib does not match. Please report this to https://github.com/pypa/pip/issues/10151 distutils: /private/var/folders/b1/_v80y9pj5x917c_phn4xsk000000gn/T/pip-build-env-5aixvc7e/overlay/lib/python3.8/site-packages sysconfig: /Library/Python/3.8/site-packages WARNING: Value for prefixed-platlib does not match. Please report this to https://github.com/pypa/pip/issues/10151 distutils: /private/var/folders/b1/_v80y9pj5x917c_phn4xsk000000gn/T/pip-build-env-5aixvc7e/overlay/lib/python3.8/site-packages sysconfig: /Library/Python/3.8/site-packages WARNING: Additional context: user = False home = None root = None prefix = '/private/var/folders/b1/_v80y9pj5x917c_phn4xsk000000gn/T/pip-build-env-5aixvc7e/overlay' Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting termcolor>=1.1.0 Downloading termcolor-1.1.0.tar.gz (3.9 kB) Preparing metadata (setup.py) ... done Collecting keras<2.8,>=2.7.0rc0 Downloading keras-2.7.0-py2.py3-none-any.whl (1.3 MB) |████████████████████████████████| 1.3 MB 7.2 MB/s
    Collecting gast<0.5.0,>=0.2.1 Downloading gast-0.4.0-py3-none-any.whl (9.8 kB) Collecting opt-einsum>=2.3.2 Downloading opt_einsum-3.3.0-py3-none-any.whl (65 kB) |████████████████████████████████| 65 kB 8.9 MB/s
    Collecting protobuf>=3.9.2 Downloading protobuf-3.19.1-py2.py3-none-any.whl (162 kB) |████████████████████████████████| 162 kB 8.2 MB/s
    Collecting tensorflow-estimator<2.8,~=2.7.0rc0 Downloading tensorflow_estimator-2.7.0-py2.py3-none-any.whl (463 kB) |████████████████████████████████| 463 kB 9.4 MB/s
    Requirement already satisfied: wheel<1.0,>=0.32.0 in /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (from tensorflow-macos) (0.33.1) Collecting keras-preprocessing>=1.1.1 Downloading Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB) |████████████████████████████████| 42 kB 2.7 MB/s
    Collecting absl-py>=0.4.0 Downloading absl_py-1.0.0-py3-none-any.whl (126 kB) |████████████████████████████████| 126 kB 12.3 MB/s
    Collecting google-pasta>=0.1.1 Downloading google_pasta-0.2.0-py3-none-any.whl (57 kB) |████████████████████████████████| 57 kB 6.1 MB/s
    Requirement already satisfied: six>=1.12.0 in /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (from tensorflow-macos) (1.15.0) Collecting wrapt>=1.11.0 Downloading wrapt-1.13.3.tar.gz (48 kB) |████████████████████████████████| 48 kB 4.8 MB/s
    Preparing metadata (setup.py) ... done Collecting astunparse>=1.6.0 Downloading astunparse-1.6.3-py2.py3-none-any.whl (12 kB) Collecting numpy>=1.14.5 Downloading numpy-1.21.4-cp38-cp38-macosx_11_0_arm64.whl (12.3 MB) |████████████████████████████████| 12.3 MB 6.3 MB/s
    Collecting flatbuffers<3.0,>=1.12 Downloading flatbuffers-2.0-py2.py3-none-any.whl (26 kB) Collecting grpcio<2.0,>=1.24.3 Downloading grpcio-1.43.0.tar.gz (21.5 MB) |████████████████████████████████| 21.5 MB 8.0 MB/s
    Preparing metadata (setup.py) ... done Collecting libclang>=9.0.1 Downloading libclang-12.0.0-py2.py3-none-macosx_11_0_arm64.whl (12.3 MB) |████████████████████████████████| 12.3 MB 11.4 MB/s
    Collecting typing-extensions>=3.6.6 Downloading typing_extensions-4.0.1-py3-none-any.whl (22 kB) Collecting tensorboard~=2.6 Downloading tensorboard-2.7.0-py3-none-any.whl (5.8 MB) |████████████████████████████████| 5.8 MB 16.4 MB/s
    Collecting werkzeug>=0.11.15 Downloading Werkzeug-2.0.2-py3-none-any.whl (288 kB) |████████████████████████████████| 288 kB 7.8 MB/s
    Collecting google-auth-oauthlib<0.5,>=0.4.1 Downloading google_auth_oauthlib-0.4.6-py2.py3-none-any.whl (18 kB) Collecting tensorboard-data-server<0.7.0,>=0.6.0 Downloading tensorboard_data_server-0.6.1-py3-none-any.whl (2.4 kB) Collecting google-auth<3,>=1.6.3 Downloading google_auth-2.3.3-py2.py3-none-any.whl (155 kB) |████████████████████████████████| 155 kB 7.1 MB/s
    Collecting requests<3,>=2.21.0 Downloading requests-2.26.0-py2.py3-none-any.whl (62 kB) |████████████████████████████████| 62 kB 4.7 MB/s
    Collecting markdown>=2.6.8 Downloading Markdown-3.3.6-py3-none-any.whl (97 kB) |████████████████████████████████| 97 kB 10.3 MB/s
    Requirement already satisfied: setuptools>=41.0.0 in /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (from tensorboard~=2.6->tensorflow-macos) (49.2.1) Collecting tensorboard-plugin-wit>=1.6.0 Downloading tensorboard_plugin_wit-1.8.0-py3-none-any.whl (781 kB) |████████████████████████████████| 781 kB 7.5 MB/s
    Collecting pyasn1-modules>=0.2.1 Downloading pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB) |████████████████████████████████| 155 kB 7.1 MB/s
    Collecting rsa<5,>=3.1.4 Downloading rsa-4.8-py3-none-any.whl (39 kB) Collecting cachetools<5.0,>=2.0.0 Downloading cachetools-4.2.4-py3-none-any.whl (10 kB) Collecting requests-oauthlib>=0.7.0 Downloading requests_oauthlib-1.3.0-py2.py3-none-any.whl (23 kB) Collecting importlib-metadata>=4.4 Downloading importlib_metadata-4.9.0-py3-none-any.whl (17 kB) Collecting certifi>=2017.4.17 Downloading certifi-2021.10.8-py2.py3-none-any.whl (149 kB) |████████████████████████████████| 149 kB 7.2 MB/s
    Collecting urllib3<1.27,>=1.21.1 Downloading urllib3-1.26.7-py2.py3-none-any.whl (138 kB) |████████████████████████████████| 138 kB 7.9 MB/s
    Collecting idna<4,>=2.5 Downloading idna-3.3-py3-none-any.whl (61 kB) |████████████████████████████████| 61 kB 5.8 MB/s
    Collecting charset-normalizer~=2.0.0 Downloading charset_normalizer-2.0.9-py3-none-any.whl (39 kB) Collecting zipp>=0.5 Downloading zipp-3.6.0-py3-none-any.whl (5.3 kB) Collecting pyasn1<0.5.0,>=0.4.6 Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB) |████████████████████████████████| 77 kB 12.5 MB/s
    Collecting oauthlib>=3.0.0 Downloading oauthlib-3.1.1-py2.py3-none-any.whl (146 kB) |████████████████████████████████| 146 kB 7.3 MB/s
    Building wheels for collected packages: grpcio, h5py, termcolor, wrapt Building wheel for grpcio (setup.py) ... done Created wheel for grpcio: filename=grpcio-1.43.0-cp38-cp38-macosx_10_14_arm64.whl size=7189537 sha256=8c59e16fb90c096ccb9c7fb9c2a440c732a99939ba1c1aca00c56f25e44240f6 Stored in directory: /Users/billhuang/Library/Caches/pip/wheels/75/43/ee/d6fff4bfd9d7a09ea9e81431dd321b13c43a4960b64be34016 Building wheel for h5py (pyproject.toml) ... error ERROR: Command errored out with exit status 1: command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Users/billhuang/Library/Python/3.8/lib/python/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/b1/_v80y9pj5x917c_phn4xsk000000gn/T/tmpnzvmgnuw cwd: /private/var/folders/b1/_v80y9pj5x917c_phn4xsk000000gn/T/pip-install-a4gv3n4i/h5py_1db389eb844d4445a327409d3e9fb83a Complete output (70 lines): running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.14-arm64-3.8 creating build/lib.macosx-10.14-arm64-3.8/h5py copying h5py/h5py_warnings.py -> build/lib.macosx-10.14-arm64-3.8/h5py copying h5py/version.py -> build/lib.macosx-10.14-arm64-3.8/h5py copying h5py/init.py -> build/lib.macosx-10.14-arm64-3.8/h5py copying h5py/ipy_completer.py -> build/lib.macosx-10.14-arm64-3.8/h5py creating build/lib.macosx-10.14-arm64-3.8/h5py/_hl copying h5py/_hl/files.py -> build/lib.macosx-10.14-arm64-3.8/h5py/_hl copying h5py/_hl/compat.py -> build/lib.macosx-10.14-arm64-3.8/h5py/_hl copying h5py/_hl/init.py -> build/lib.macosx-10.14-arm64-3.8/h5py/_hl copying h5py/_hl/selections.py -> build/lib.macosx-10.14-arm64-3.8/h5py/_hl copying h5py/_hl/dataset.py -> build/lib.macosx-10.14-arm64-3.8/h5py/_hl copying h5py/_hl/vds.py -> build/lib.macosx-10.14-arm64-3.8/h5py/_hl copying h5py/_hl/selections2.py -> build/lib.macosx-10.14-arm64-3.8/h5py/_hl copying h5py/_hl/group.py -> build/lib.macosx-10.14-arm64-3.8/h5py/_hl copying h5py/_hl/datatype.py -> build/lib.macosx-10.14-arm64-3.8/h5py/_hl copying h5py/_hl/attrs.py -> build/lib.macosx-10.14-arm64-3.8/h5py/_hl copying h5py/_hl/dims.py -> build/lib.macosx-10.14-arm64-3.8/h5py/_hl copying h5py/_hl/base.py -> build/lib.macosx-10.14-arm64-3.8/h5py/_hl copying h5py/_hl/filters.py -> build/lib.macosx-10.14-arm64-3.8/h5py/_hl creating build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_dimension_scales.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_attribute_create.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_file_image.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/conftest.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_h5d_direct_chunk.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_h5f.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_dataset_getitem.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_group.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_errors.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_dataset_swmr.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_slicing.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_h5pl.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_attrs.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/init.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_attrs_data.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_h5t.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_big_endian_file.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_h5p.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_dims_dimensionproxy.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_h5o.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_datatype.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/common.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_dataset.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_file.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_selections.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_dtype.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_h5.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_file2.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_completions.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_filters.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_base.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests copying h5py/tests/test_objects.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests creating build/lib.macosx-10.14-arm64-3.8/h5py/tests/data_files copying h5py/tests/data_files/init.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests/data_files creating build/lib.macosx-10.14-arm64-3.8/h5py/tests/test_vds copying h5py/tests/test_vds/test_highlevel_vds.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests/test_vds copying h5py/tests/test_vds/test_virtual_source.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests/test_vds copying h5py/tests/test_vds/init.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests/test_vds copying h5py/tests/test_vds/test_lowlevel_vds.py -> build/lib.macosx-10.14-arm64-3.8/h5py/tests/test_vds copying h5py/tests/data_files/vlen_string_s390x.h5 -> build/lib.macosx-10.14-arm64-3.8/h5py/tests/data_files copying h5py/tests/data_files/vlen_string_dset_utc.h5 -> build/lib.macosx-10.14-arm64-3.8/h5py/tests/data_files copying h5py/tests/data_files/vlen_string_dset.h5 -> build/lib.macosx-10.14-arm64-3.8/h5py/tests/data_files running build_ext Building h5py requires pkg-config unless the HDF5 path is explicitly specified error: pkg-config probably not installed: FileNotFoundError(2, 'No such file or directory')

    ERROR: Failed building wheel for h5py Building wheel for termcolor (setup.py) ... done Created wheel for termcolor: filename=termcolor-1.1.0-py3-none-any.whl size=4830 sha256=3d21bd58f207bea71ef3b49fe19d4ea57d1bb49d26196616149eb58d39179173 Stored in directory: /Users/billhuang/Library/Caches/pip/wheels/a0/16/9c/5473df82468f958445479c59e784896fa24f4a5fc024b0f501 Building wheel for wrapt (setup.py) ... done Created wheel for wrapt: filename=wrapt-1.13.3-cp38-cp38-macosx_10_14_arm64.whl size=47927 sha256=fb991bad4a02f68b0b583041b67089acb2d1e6ddc48646eb63b37ad3b015ff4a Stored in directory: /Users/billhuang/Library/Caches/pip/wheels/bb/05/57/f0c531fdf04b11be18b21ab4d1ec5586a6897caa6710c2a1a5 Successfully built grpcio termcolor wrapt Failed to build h5py ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects

    opened by buffalobillhuang 7
  • Could not find a version that satisfies the requirement tensorflow-macos

    Could not find a version that satisfies the requirement tensorflow-macos

    Hi,

    Not really sure where the error is coming from, but I am getting the following error. ERROR: Could not find a version that satisfies the requirement tensorflow-macos (from versions: none) ERROR: No matching distribution found for tensorflow-macos

    Followed everything in your tutorial up to part 5 without any problems.

    opened by ivy113 3
  • Environment unmanageable

    Environment unmanageable

    You can activate and deactivate per your guide:

    (base) adam@hapkido ~/projects/tensorflow-test $ conda activate ./env
    (/Users/adam/projects/tensorflow-test/env) adam@hapkido ~/projects/tensorflow-test $ conda deactivate
    (base) adam@hapkido ~/projects/tensorflow-test $ conda info --envs
    # conda environments:
    #
    base                  *  /Users/adam/projects/miniforge3
                             /Users/adam/projects/tensorflow-test/env
    

    But some of the other conda commands fail as the name of the environment is invalid:

    (base) adam@hapkido ~/projects/tensorflow-test $ conda remove --name ./env --all
    
    CondaValueError: Invalid environment name: './env'
      Characters not allowed: ('/', ' ', ':', '#')
    
    opened by acgetchell 1
  • getting error while doing

    getting error while doing "python -m pip install tensorflow-macos"

    Loading library to get build settings and version: libhdf5.dylib error: Unable to load dependency HDF5, make sure HDF5 is installed properly error: dlopen(libhdf5.dylib, 0x0006): tried: 'libhdf5.dylib' (no such file), '/usr/lib/libhdf5.dylib' (no such file), '/private/var/folders/b1/_v80y9pj5x917c_phn4xsk000000gn/T/pip-install-o3l1cnqc/h5py_955ebded70b446b7870af246fe94f112/libhdf5.dylib' (no such file), '/usr/lib/libhdf5.dylib' (no such file)

    ERROR: Failed building wheel for h5py Failed to build h5py

    opened by buffalobillhuang 0
  • Trouble while running Tensorflow after installing TensorFlow-metal

    Trouble while running Tensorflow after installing TensorFlow-metal

    I followed the instructions, but afterwards I get the errorcode

    Could not identify NUMA node of platform GPU ID 0, defaulting to 0. Your kernel may not have been built with NUMA support.

    every time I run something with Tensorflow. The program runs as otherwise expected, and the programs does not stop but continues to run, only very slow (far slower than using CPU).

    Besides that errorcode I also get

    Plugin optimizer for device_type GPU is enabled.

    every time.

    I am using a regular M1, and have followed the instructions, and also tested the "list physical devices" which works just fine.

    TensorFlow 2.7

    opened by mikkel-larsen 0
  • Precision issues with Tensorflow-metal

    Precision issues with Tensorflow-metal

    Calculations on GPU leads to drastically different results compared to CPU.

    MNIST GAN: GPU: image_at_epoch_0036 CPU: image_at_epoch_0036

    Stock prediction LSTM: GPU: graph CPU: graph

    Installed according to your manual.

    MNIST GAN source code from: https://www.tensorflow.org/tutorials/generative/dcgan My implementation and results: https://disk.yandex.ru/d/E-hU5dpffOmkLg

    Stock prediction source code from: https://www.thepythoncode.com/article/stock-price-prediction-in-python-using-tensorflow-2-and-keras My implementation and results: https://disk.yandex.ru/d/S0FqJTL582V1Pw

    PC with CUDA GPU gives correct result similar to M1 CPU only computation.

    macOs Monterey 12.1, MBA M1 tensorflow-macos 2.7.0 tensorflow-metal 0.3.0

    opened by mpodzhigai 0
  • Error when importing tensorflow in jupyter notebooks

    Error when importing tensorflow in jupyter notebooks

    when running the following block import numpy as np import pandas as pd import sklearn import tensorflow as tf import matplotlib.pyplot as plt

    Check for TensorFlow GPU access

    print(f"TensorFlow has access to the following devices:\n{tf.config.list_physical_devices()}")

    See TensorFlow version

    print(f"TensorFlow version: {tf.version}")

    i get the following error.

    ImportError Traceback (most recent call last) ~/Desktop/RNA_fold/env/lib/python3.8/site-packages/numpy/core/init.py in 21 try: ---> 22 from . import multiarray 23 except ImportError as exc:

    ~/Desktop/RNA_fold/env/lib/python3.8/site-packages/numpy/core/multiarray.py in 11 ---> 12 from . import overrides 13 from . import _multiarray_umath

    ~/Desktop/RNA_fold/env/lib/python3.8/site-packages/numpy/core/overrides.py in 6 ----> 7 from numpy.core._multiarray_umath import ( 8 add_docstring, implement_array_function, _get_implementing_args)

    ImportError: dlopen(/Users/floydjaggy/Desktop/RNA_fold/env/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so, 0x0002): Library not loaded: @rpath/libcblas.3.dylib Referenced from: /Users/floydjaggy/Desktop/RNA_fold/env/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so Reason: tried: '/Users/floydjaggy/Desktop/RNA_fold/env/lib/libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/lib/libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/lib/python3.8/site-packages/numpy/core/../../../../libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/lib/libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/lib/libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/lib/python3.8/site-packages/numpy/core/../../../../libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/lib/libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/bin/../lib/libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/lib/libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/bin/../lib/libcblas.3.dylib' (no such file), '/usr/local/lib/libcblas.3.dylib' (no such file), '/usr/lib/libcblas.3.dylib' (no such file)

    During handling of the above exception, another exception occurred:

    ImportError Traceback (most recent call last) /var/folders/fd/c7pllh790y9231d9wj4y6pym0000gn/T/ipykernel_13997/116520098.py in ----> 1 import numpy as np 2 import pandas as pd 3 import sklearn 4 import tensorflow as tf 5 import matplotlib.pyplot as plt

    ~/Desktop/RNA_fold/env/lib/python3.8/site-packages/numpy/init.py in 138 from . import _distributor_init 139 --> 140 from . import core 141 from .core import * 142 from . import compat

    ~/Desktop/RNA_fold/env/lib/python3.8/site-packages/numpy/core/init.py in 46 """ % (sys.version_info[0], sys.version_info[1], sys.executable, 47 version, exc) ---> 48 raise ImportError(msg) 49 finally: 50 for envkey in env_added:

    ImportError:

    IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

    Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed.

    We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html
    

    Please note and check the following:

    • The Python version is: Python3.8 from "/Users/floydjaggy/Desktop/RNA_fold/env/bin/python"
    • The NumPy version is: "1.19.5"

    and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help.

    Original error was: dlopen(/Users/floydjaggy/Desktop/RNA_fold/env/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so, 0x0002): Library not loaded: @rpath/libcblas.3.dylib Referenced from: /Users/floydjaggy/Desktop/RNA_fold/env/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so Reason: tried: '/Users/floydjaggy/Desktop/RNA_fold/env/lib/libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/lib/libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/lib/python3.8/site-packages/numpy/core/../../../../libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/lib/libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/lib/libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/lib/python3.8/site-packages/numpy/core/../../../../libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/lib/libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/bin/../lib/libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/lib/libcblas.3.dylib' (no such file), '/Users/floydjaggy/Desktop/RNA_fold/env/bin/../lib/libcblas.3.dylib' (no such file), '/usr/local/lib/libcblas.3.dylib' (no such file), '/usr/lib/libcblas.3.dylib' (no such file)

    i installed numpy in the virtual environment using the given command of conda install jupyter pandas numpy matplotlib scikit-learn

    any help is much appreciated

    opened by floydjaggy 1
Owner
Daniel Bourke
Machine Learning Engineer live on YouTube.
Daniel Bourke
Code and model benchmarks for "SEVIR : A Storm Event Imagery Dataset for Deep Learning Applications in Radar and Satellite Meteorology"

NeurIPS 2020 SEVIR Code for paper: SEVIR : A Storm Event Imagery Dataset for Deep Learning Applications in Radar and Satellite Meteorology Requirement

USAF - MIT Artificial Intelligence Accelerator 46 Dec 15, 2022
Source code and notebooks to reproduce experiments and benchmarks on Bias Faces in the Wild (BFW).

Face Recognition: Too Bias, or Not Too Bias? Robinson, Joseph P., Gennady Livitz, Yann Henon, Can Qin, Yun Fu, and Samson Timoner. "Face recognition:

Joseph P. Robinson 41 Dec 12, 2022
Training code and evaluation benchmarks for the "Self-Supervised Policy Adaptation during Deployment" paper.

Self-Supervised Policy Adaptation during Deployment PyTorch implementation of PAD and evaluation benchmarks from Self-Supervised Policy Adaptation dur

Nicklas Hansen 101 Nov 1, 2022
"NAS-Bench-301 and the Case for Surrogate Benchmarks for Neural Architecture Search".

NAS-Bench-301 This repository containts code for the paper: "NAS-Bench-301 and the Case for Surrogate Benchmarks for Neural Architecture Search". The

AutoML-Freiburg-Hannover 57 Nov 30, 2022
Benchmarks for semi-supervised domain generalization.

Semi-Supervised Domain Generalization This code is the official implementation of the following paper: Semi-Supervised Domain Generalization with Stoc

Kaiyang 49 Dec 10, 2022
Sequence modeling benchmarks and temporal convolutional networks

Sequence Modeling Benchmarks and Temporal Convolutional Networks (TCN) This repository contains the experiments done in the work An Empirical Evaluati

CMU Locus Lab 3.5k Jan 1, 2023
NeurIPS 2021 Datasets and Benchmarks Track

AP-10K: A Benchmark for Animal Pose Estimation in the Wild Introduction | Updates | Overview | Download | Training Code | Key Questions | License Intr

AP-10K 82 Dec 11, 2022
Benchmarks for the Optimal Power Flow Problem

Power Grid Lib - Optimal Power Flow This benchmark library is curated and maintained by the IEEE PES Task Force on Benchmarks for Validation of Emergi

A Library of IEEE PES Power Grid Benchmarks 207 Dec 8, 2022
Benchmark spaces - Benchmarks of how well different two dimensional spaces work for clustering algorithms

benchmark_spaces Benchmarks of how well different two dimensional spaces work fo

Bram Cohen 6 May 7, 2022
Deploy tensorflow graphs for fast evaluation and export to tensorflow-less environments running numpy.

Deploy tensorflow graphs for fast evaluation and export to tensorflow-less environments running numpy. Now with tensorflow 1.0 support. Evaluation usa

Marcel R. 349 Aug 6, 2022
TensorFlow Ranking is a library for Learning-to-Rank (LTR) techniques on the TensorFlow platform

TensorFlow Ranking is a library for Learning-to-Rank (LTR) techniques on the TensorFlow platform

null 2.6k Jan 4, 2023
Robust Video Matting in PyTorch, TensorFlow, TensorFlow.js, ONNX, CoreML!

Robust Video Matting in PyTorch, TensorFlow, TensorFlow.js, ONNX, CoreML!

Peter Lin 6.5k Jan 4, 2023
Robust Video Matting in PyTorch, TensorFlow, TensorFlow.js, ONNX, CoreML!

Robust Video Matting (RVM) English | 中文 Official repository for the paper Robust High-Resolution Video Matting with Temporal Guidance. RVM is specific

flow-dev 2 Aug 21, 2022
FindFunc is an IDA PRO plugin to find code functions that contain a certain assembly or byte pattern, reference a certain name or string, or conform to various other constraints.

FindFunc: Advanced Filtering/Finding of Functions in IDA Pro FindFunc is an IDA Pro plugin to find code functions that contain a certain assembly or b

null 213 Dec 17, 2022
Pytorch and Torch testing code of CartoonGAN

CartoonGAN-Test-Pytorch-Torch Pytorch and Torch testing code of CartoonGAN [Chen et al., CVPR18]. With the released pretrained models by the authors,

Yijun Li 642 Dec 27, 2022
Static-test - A playground to play with ideas related to testing the comparability of the code

Static test playground ⚠️ The code is just an experiment. Compiles and runs on U

Igor Bogoslavskyi 4 Feb 18, 2022
TensorFlow code for the neural network presented in the paper: "Structural Language Models of Code" (ICML'2020)

SLM: Structural Language Models of Code This is an official implementation of the model described in: "Structural Language Models of Code" [PDF] To ap

null 73 Nov 6, 2022
Home repository for the Regularized Greedy Forest (RGF) library. It includes original implementation from the paper and multithreaded one written in C++, along with various language-specific wrappers.

Regularized Greedy Forest Regularized Greedy Forest (RGF) is a tree ensemble machine learning method described in this paper. RGF can deliver better r

RGF-team 364 Dec 28, 2022
Pytorch Implementation of Various Point Transformers

Pytorch Implementation of Various Point Transformers Recently, various methods applied transformers to point clouds: PCT: Point Cloud Transformer (Men

Neil You 434 Dec 30, 2022