Giter VIP home page Giter VIP logo

m1-machine-learning-test's Introduction

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, M1 Max, M1 Ultra or M2 Mac to run the code.

Who is this repo for?

You: have a new M1, M1 Pro, M1 Max, M1 Ultra or M2 Mac 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 Apple Silicon 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, M1 Ultra, M2 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, M1 Ultra, M2 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.

m1-machine-learning-test's People

Contributors

kittyborgx avatar mrdbourke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

m1-machine-learning-test's Issues

ModuleNotFoundError when trying to run jupyter notebook

I followed all the steps up to the point where I try to open jupyter notebook. I get the message:
File "/Users/jaimetorressohle/tensorflow-test/env/lib/python3.8/site-packages/requests/compat.py", line 11, in
import chardet
ModuleNotFoundError: No module named 'chardet'
Followed with:
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/jaimetorressohle/tensorflow-test/env/bin/jupyter-notebook", line 7, in
from notebook.app import main
File "/Users/jaimetorressohle/tensorflow-test/env/lib/python3.8/site-packages/notebook/app.py", line 20, in
from jupyterlab.commands import ( # type:ignore[import-untyped]
File "/Users/jaimetorressohle/tensorflow-test/env/lib/python3.8/site-packages/jupyterlab/init.py", line 8, in
from .handlers.announcements import (
File "/Users/jaimetorressohle/tensorflow-test/env/lib/python3.8/site-packages/jupyterlab/handlers/announcements.py", line 15, in
from jupyterlab_server.translation_utils import translator
File "/Users/jaimetorressohle/tensorflow-test/env/lib/python3.8/site-packages/jupyterlab_server/init.py", line 6, in
from .app import LabServerApp
File "/Users/jaimetorressohle/tensorflow-test/env/lib/python3.8/site-packages/jupyterlab_server/app.py", line 15, in
from .handlers import LabConfig, add_handlers
File "/Users/jaimetorressohle/tensorflow-test/env/lib/python3.8/site-packages/jupyterlab_server/handlers.py", line 21, in
from .listings_handler import ListingsHandler, fetch_listings
File "/Users/jaimetorressohle/tensorflow-test/env/lib/python3.8/site-packages/jupyterlab_server/listings_handler.py", line 10, in
import requests
File "/Users/jaimetorressohle/tensorflow-test/env/lib/python3.8/site-packages/requests/init.py", line 45, in
from .exceptions import RequestsDependencyWarning
File "/Users/jaimetorressohle/tensorflow-test/env/lib/python3.8/site-packages/requests/exceptions.py", line 9, in
from .compat import JSONDecodeError as CompatJSONDecodeError
File "/Users/jaimetorressohle/tensorflow-test/env/lib/python3.8/site-packages/requests/compat.py", line 13, in
import charset_normalizer as chardet
File "/Users/jaimetorressohle/tensorflow-test/env/lib/python3.8/site-packages/charset_normalizer/init.py", line 23, in
from charset_normalizer.api import from_fp, from_path, from_bytes, normalize
File "/Users/jaimetorressohle/tensorflow-test/env/lib/python3.8/site-packages/charset_normalizer/api.py", line 10, in
from charset_normalizer.md import mess_ratio
File "charset_normalizer/md.py", line 5, in
from charset_normalizer.utils import is_punctuation, is_symbol, unicode_range, is_accentuated, is_latin,
ImportError: cannot import name 'COMMON_SAFE_ASCII_CHARACTERS' from 'charset_normalizer.constant' (/Users/jaimetorressohle/tensorflow-test/env/lib/python3.8/site-packages/charset_normalizer/constant.py)

Any suggestions?

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: ('/', ' ', ':', '#')

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

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

Poor Performance

Hello everyone,

I wanted to let you know that I followed your tutorial and was eventually able to successfully install everything after a few attempts.

Currently, I am in the process of training a Yolov5 model on my MacBook Pro M1 14''. However, I have noticed that the performance is very poor, taking about 5 minutes per epoch. In comparison, on Google Colab, it only takes about 5 seconds. I checked the Activity Monitor and noticed that both the GPU and CPU usage are almost non-existent.


      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
     7/1999         0G    0.04825    0.02977    0.07487         26        640: 1
                 Class     Images  Instances          P          R      mAP50   
                   all         25         25    0.00357       0.12      0.016    0.00624

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
     8/1999         0G    0.04525    0.03012    0.07478         26        640: 1
                 Class     Images  Instances          P          R      mAP50   
                   all         25         25          0          0          0          0

I have noticed that the GPU_mem is consistently at zero for each epoch. Do you have any ideas as to what I may be doing wrong?

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

cannot open up notebook python file:

Hi I was trying to open up jupyter notebook but when I wish to create a python 3 file, it shows: 500 : Internal Server Error

(base) tyz@Yus-MacBook-Pro ~ % cd tensorflow-test
(base) tyz@Yus-MacBook-Pro tensorflow-test % conda activate ./env
(/Users/tyz/tensorflow-test/env) tyz@Yus-MacBook-Pro tensorflow-test % jupyter notebook


| | | |_ __ | | | | ___
| || | ' / / _ | / -)
_/| ./_
,_,|____|
|_|

Read the migration plan to Notebook 7 to learn about the new features and the actions to take if you are using extensions.

https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html

Please note that updating to Notebook 7 might break some of your extensions.

[W 14:08:31.476 NotebookApp] Error loading server extension jupyterlab
Traceback (most recent call last):
File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/requests/compat.py", line 11, in
import chardet
ModuleNotFoundError: No module named 'chardet'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/notebook/notebookapp.py", line 2043, in init_server_extensions
    func(self)
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/jupyterlab/serverextension.py", line 8, in load_jupyter_server_extension
    from .labapp import LabApp
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/jupyterlab/labapp.py", line 15, in <module>
    from jupyterlab_server import (
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/jupyterlab_server/__init__.py", line 5, in <module>
    from .app import LabServerApp
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/jupyterlab_server/app.py", line 10, in <module>
    from .handlers import LabConfig, add_handlers
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/jupyterlab_server/handlers.py", line 18, in <module>
    from .listings_handler import ListingsHandler, fetch_listings
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/jupyterlab_server/listings_handler.py", line 8, in <module>
    import requests
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/requests/__init__.py", line 45, in <module>
    from .exceptions import RequestsDependencyWarning
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/requests/exceptions.py", line 9, in <module>
    from .compat import JSONDecodeError as CompatJSONDecodeError
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/requests/compat.py", line 13, in <module>
    import charset_normalizer as chardet
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/charset_normalizer/__init__.py", line 23, in <module>
    from charset_normalizer.api import from_fp, from_path, from_bytes, normalize
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/charset_normalizer/api.py", line 10, in <module>
    from charset_normalizer.md import mess_ratio
  File "charset_normalizer/md.py", line 5, in <module>
    from charset_normalizer.utils import is_punctuation, is_symbol, unicode_range, is_accentuated, is_latin, \
ImportError: cannot import name 'COMMON_SAFE_ASCII_CHARACTERS' from 'charset_normalizer.constant' (/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/charset_normalizer/constant.py)

[I 14:08:31.478 NotebookApp] Serving notebooks from local directory: /Users/tyz/tensorflow-test
[I 14:08:31.478 NotebookApp] Jupyter Notebook 6.5.3 is running at:
[I 14:08:31.478 NotebookApp] http://localhost:8888/?token=2d4f247d80681f57da70a64cd7a934027961be5d54451415
[I 14:08:31.478 NotebookApp] or http://127.0.0.1:8888/?token=2d4f247d80681f57da70a64cd7a934027961be5d54451415
[I 14:08:31.478 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:08:31.480 NotebookApp]

To access the notebook, open this file in a browser:
    file:///Users/tyz/Library/Jupyter/runtime/nbserver-8200-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/?token=2d4f247d80681f57da70a64cd7a934027961be5d54451415
 or http://127.0.0.1:8888/?token=2d4f247d80681f57da70a64cd7a934027961be5d54451415

[E 14:08:55.131 NotebookApp] Uncaught exception GET /notebooks/Untitled.ipynb (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Untitled.ipynb', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/bs4/dammit.py", line 28, in
import cchardet as chardet_module
ModuleNotFoundError: No module named 'cchardet'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/bs4/dammit.py", line 33, in <module>
    import chardet as chardet_module
ModuleNotFoundError: No module named 'chardet'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/tornado/web.py", line 1713, in _execute
    result = await result
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/tornado/gen.py", line 782, in run
    yielded = self.gen.send(value)
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/notebook/notebook/handlers.py", line 94, in get
    self.write(self.render_template('notebook.html',
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/notebook/base/handlers.py", line 511, in render_template
    return template.render(**ns)
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
    {% extends "page.html" %}
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/notebook/templates/page.html", line 185, in top-level template code
    {% block header %}
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/notebook/templates/notebook.html", line 115, in block 'header'
    {% for exporter in get_frontend_exporters() %}
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/notebook/notebook/handlers.py", line 23, in get_frontend_exporters
    from nbconvert.exporters.base import get_export_names, get_exporter
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/nbconvert/__init__.py", line 3, in <module>
    from . import filters, postprocessors, preprocessors, writers
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/nbconvert/filters/__init__.py", line 8, in <module>
    from .markdown import *
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/nbconvert/filters/markdown.py", line 13, in <module>
    from .markdown_mistune import markdown2html_mistune
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/nbconvert/filters/markdown_mistune.py", line 23, in <module>
    import bs4
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/bs4/__init__.py", line 37, in <module>
    from .builder import (
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/bs4/builder/__init__.py", line 9, in <module>
    from bs4.element import (
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/bs4/element.py", line 19, in <module>
    from bs4.formatter import (
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/bs4/formatter.py", line 1, in <module>
    from bs4.dammit import EntitySubstitution
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/bs4/dammit.py", line 37, in <module>
    import charset_normalizer as chardet_module
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/charset_normalizer/__init__.py", line 23, in <module>
    from charset_normalizer.api import from_fp, from_path, from_bytes, normalize
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/charset_normalizer/api.py", line 10, in <module>
    from charset_normalizer.md import mess_ratio
AttributeError: partially initialized module 'charset_normalizer' has no attribute 'md__mypyc' (most likely due to a circular import)

[E 14:08:55.136 NotebookApp] {
"Host": "localhost:8888",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7",
"Referer": "http://localhost:8888/tree",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
}
[E 14:08:55.136 NotebookApp] 500 GET /notebooks/Untitled.ipynb (::1) 73.710000ms referer=http://localhost:8888/tree
[E 14:12:00.708 NotebookApp] Uncaught exception GET /notebooks/Untitled.ipynb (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Untitled.ipynb', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/bs4/dammit.py", line 28, in
import cchardet as chardet_module
ModuleNotFoundError: No module named 'cchardet'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/bs4/dammit.py", line 33, in <module>
    import chardet as chardet_module
ModuleNotFoundError: No module named 'chardet'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/tornado/web.py", line 1713, in _execute
    result = await result
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/tornado/gen.py", line 782, in run
    yielded = self.gen.send(value)
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/notebook/notebook/handlers.py", line 94, in get
    self.write(self.render_template('notebook.html',
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/notebook/base/handlers.py", line 511, in render_template
    return template.render(**ns)
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
    {% extends "page.html" %}
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/notebook/templates/page.html", line 185, in top-level template code
    {% block header %}
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/notebook/templates/notebook.html", line 115, in block 'header'
    {% for exporter in get_frontend_exporters() %}
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/notebook/notebook/handlers.py", line 23, in get_frontend_exporters
    from nbconvert.exporters.base import get_export_names, get_exporter
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/nbconvert/__init__.py", line 3, in <module>
    from . import filters, postprocessors, preprocessors, writers
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/nbconvert/filters/__init__.py", line 8, in <module>
    from .markdown import *
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/nbconvert/filters/markdown.py", line 13, in <module>
    from .markdown_mistune import markdown2html_mistune
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/nbconvert/filters/markdown_mistune.py", line 23, in <module>
    import bs4
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/bs4/__init__.py", line 37, in <module>
    from .builder import (
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/bs4/builder/__init__.py", line 9, in <module>
    from bs4.element import (
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/bs4/element.py", line 19, in <module>
    from bs4.formatter import (
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/bs4/formatter.py", line 1, in <module>
    from bs4.dammit import EntitySubstitution
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/bs4/dammit.py", line 37, in <module>
    import charset_normalizer as chardet_module
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/charset_normalizer/__init__.py", line 23, in <module>
    from charset_normalizer.api import from_fp, from_path, from_bytes, normalize
  File "/Users/tyz/tensorflow-test/env/lib/python3.8/site-packages/charset_normalizer/api.py", line 10, in <module>
    from charset_normalizer.md import mess_ratio
AttributeError: partially initialized module 'charset_normalizer' has no attribute 'md__mypyc' (most likely due to a circular import)

[E 14:12:00.711 NotebookApp] {
"Host": "localhost:8888",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7",
"Referer": "http://localhost:8888/tree",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
}
[E 14:12:00.712 NotebookApp] 500 GET /notebooks/Untitled.ipynb (::1) 16.580000ms referer=http://localhost:8888/tree

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

When trying to run the code, in Jupyter it always restarts

Kernel Restarting
The kernel for Untitled.ipynb appears to have died. It will restart automatically.

[D 2023-08-25 17:12:14.399 ServerApp] Accepting token-authenticated request from ::1 [D 2023-08-25 17:12:14.401 ServerApp] 200 GET /api/contents/Untitled.ipynb/checkpoints?1692979934395 (dc9f29f487ed46a38796cc35484a0c0a@::1) 2.97ms [I 2023-08-25 17:12:15.769 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (1/5), keep random ports [W 2023-08-25 17:12:15.769 ServerApp] kernel e2dcf2e8-1352-4305-957d-eedf1d33904a restarted [D 2023-08-25 17:12:15.778 ServerApp] Websocket closed e2dcf2e8-1352-4305-957d-eedf1d33904a:b37bd840-f8d0-43f7-97f3-b6701599982d [I 2023-08-25 17:12:15.779 ServerApp] Starting buffering for e2dcf2e8-1352-4305-957d-eedf1d33904a:b37bd840-f8d0-43f7-97f3-b6701599982d [D 2023-08-25 17:12:15.779 ServerApp] Clearing buffer for e2dcf2e8-1352-4305-957d-eedf1d33904a [D 2023-08-25 17:12:15.782 ServerApp] Starting kernel: ['/Users/x/.pyenv/versions/3.8.12/bin/python3.8', '-m', 'ipykernel_launcher', '-f', '/Users/x/Library/Jupyter/runtime/kernel-e2dcf2e8-1352-4305-957d-eedf1d33904a.json'] [D 2023-08-25 17:12:15.839 ServerApp] Connecting to: tcp://127.0.0.1:56889 [D 2023-08-25 17:12:15.853 ServerApp] 101 GET /api/kernels/e2dcf2e8-1352-4305-957d-eedf1d33904a/channels?session_id=b37bd840-f8d0-43f7-97f3-b6701599982d (dc9f29f487ed46a38796cc35484a0c0a@::1) 11.96ms [D 2023-08-25 17:12:15.853 ServerApp] Opening websocket /api/kernels/e2dcf2e8-1352-4305-957d-eedf1d33904a/channels [I 2023-08-25 17:12:15.853 ServerApp] Connecting to kernel e2dcf2e8-1352-4305-957d-eedf1d33904a. [D 2023-08-25 17:12:15.854 ServerApp] Getting buffer for e2dcf2e8-1352-4305-957d-eedf1d33904a [I 2023-08-25 17:12:15.854 ServerApp] Restoring connection for e2dcf2e8-1352-4305-957d-eedf1d33904a:b37bd840-f8d0-43f7-97f3-b6701599982d [D 2023-08-25 17:12:15.854 ServerApp] Nudge: not nudging busy kernel e2dcf2e8-1352-4305-957d-eedf1d33904a [D 2023-08-25 17:12:16.255 ServerApp] Accepting token-authenticated request from ::1 [D 2023-08-25 17:12:16.255 TerminalsExtensionApp] 200 GET /api/terminals?1692979936251 (dc9f29f487ed46a38796cc35484a0c0a@::1) 0.76ms [D 2023-08-25 17:12:16.408 ServerApp] Accepting token-authenticated request from ::1 [D 2023-08-25 17:12:16.409 ServerApp] 200 GET /api/contents/Untitled.ipynb/checkpoints?1692979936404 (dc9f29f487ed46a38796cc35484a0c0a@::1) 1.85ms [D 2023-08-25 17:12:16.436 ServerApp] activity on e2dcf2e8-1352-4305-957d-eedf1d33904a: status (starting) [D 2023-08-25 17:12:16.463 ServerApp] activity on e2dcf2e8-1352-4305-957d-eedf1d33904a: status (busy) [D 2023-08-25 17:12:16.464 ServerApp] activity on e2dcf2e8-1352-4305-957d-eedf1d33904a: status (idle)

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.

can not import tensorflow package


RuntimeError Traceback (most recent call last)
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf


ImportError Traceback (most recent call last)
ImportError: numpy.core.multiarray failed to import

The above exception was the direct cause of the following exception:

SystemError Traceback (most recent call last)
SystemError: <built-in method contains of dict object at 0x138a8b6c0> returned a result with an error set

The above exception was the direct cause of the following exception:

ImportError Traceback (most recent call last)
Cell In[18], line 1
----> 1 import tensorflow as tf
2 print('done')
5 # Check for TensorFlow GPU access

File ~/tensorflow-test/env/lib/python3.8/site-packages/tensorflow/init.py:37
34 import sys as _sys
35 import typing as _typing
---> 37 from tensorflow.python.tools import module_util as _module_util
38 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
40 # Make sure code inside the TensorFlow codebase can use tf2.enabled() at import.

File ~/tensorflow-test/env/lib/python3.8/site-packages/tensorflow/python/init.py:37
29 # We aim to keep this file minimal and ideally remove completely.
30 # If you are adding a new file with @tf_export decorators,
31 # import it in modules_with_exports.py instead.
32
33 # go/tf-wildcard-import
34 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top
36 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
---> 37 from tensorflow.python.eager import context
39 # pylint: enable=wildcard-import
40
41 # Bring in subpackages.
42 from tensorflow.python import data

File ~/tensorflow-test/env/lib/python3.8/site-packages/tensorflow/python/eager/context.py:33
31 from tensorflow.python import pywrap_tfe
32 from tensorflow.python import tf2
---> 33 from tensorflow.python.client import pywrap_tf_session
34 from tensorflow.python.eager import executor
35 from tensorflow.python.eager import monitoring

File ~/tensorflow-test/env/lib/python3.8/site-packages/tensorflow/python/client/pywrap_tf_session.py:19
17 # pylint: disable=invalid-import-order,g-bad-import-order, wildcard-import, unused-import
18 from tensorflow.python import pywrap_tensorflow
---> 19 from tensorflow.python.client._pywrap_tf_session import *
20 from tensorflow.python.client._pywrap_tf_session import _TF_SetTarget
21 from tensorflow.python.client._pywrap_tf_session import _TF_SetConfig

ImportError: initialization failed

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 pypa/pip#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 pypa/pip#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 pypa/pip#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 pypa/pip#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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.