Skip to content

MacOS 13 Apple Silicon (M1 or M2 chip) with GPU acceleration

Peter Leonard edited this page Mar 21, 2023 · 6 revisions
  1. This was tested on macOS Ventura (13.2.1)

  2. Install Miniforge for Apple Silicon. (See project page for more info.)

  3. Create a new environment for pixplot:

conda create --name pixplot python=3.9

conda activate pixplot

  1. Install the required packages for Apple's support of Tensorflow on the M1 chip:
conda install -c apple tensorflow-deps
python -m pip install tensorflow-macos
python -m pip install tensorflow-metal
  1. Clone pixplot:

git clone https://github.com/YaleDHLab/pix-plot.git

  1. Adjust the install_requires section of setup.py to read as follows:
 install_requires=[
    'cmake',
    'Cython',
    'glob2',
    'h5py',
    'iiif-downloader',
    'matplotlib',
    'numpy==1.23.5',
    'numba',
    'pytz',
    'pointgrid>=0.0.2',
    'python-dateutil>=2.8.0',
    'scikit-learn',
    'scipy',
    'six',
    'tqdm',
    'umap-learn',
    'yale-dhlab-rasterfairy>=1.0.3',
    'yale-dhlab-keras-preprocessing>=1.1.1',
  ],
  1. Install:
python setup.py install
  1. Temporary fixes till we figure things out:
pip install --force matplotlib
pip install --force scipy
pip install --force numba
  1. Run:
time pixplot --images="datasets/oslomini/images/*.jpg" --metadata="datasets/oslomini/metadata/metadata.csv" --shuffle