Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PeekingDuck Installation for Apple Silicon Mac macOS Big Sur/Monterey #445

Open
leeping-ng opened this issue Aug 30, 2021 · 4 comments
Open
Labels
documentation Improvements or additions to documentation

Comments

@leeping-ng
Copy link
Contributor

leeping-ng commented Aug 30, 2021

Please see updated instructions below.

@leeping-ng leeping-ng added the documentation Improvements or additions to documentation label Aug 30, 2021
@diwei-tan
Copy link
Contributor

After installation I tried:
peekingduck init then peekingduck run. Got the following error:

❯ peekingduck run
2021-10-19 11:44:32 peekingduck.declarative_loader INFO: Successfully loaded run_config file.
2021-10-19 11:44:32 peekingduck.declarative_loader INFO: Initialising input.live node...
2021-10-19 11:44:34 peekingduck.pipeline.nodes.input.live INFO: Device resolution used: 1280 by 720
2021-10-19 11:44:34 peekingduck.declarative_loader INFO: Initialising model.yolo node...
2021-10-19 11:44:35 peekingduck.pipeline.nodes.model.yolov4.yolo_files.detector INFO: Yolo model loaded with following configs:
Model type: v4tiny,
Input resolution: 416,
IDs being detected: [0]
Max Detections per class: 50,
Max Total Detections: 50,
IOU threshold: 0.5,
Score threshold: 0.2
Metal device set to: Apple M1

systemMemory: 16.00 GB
maxCacheSize: 5.33 GB

2021-10-19 11:44:36 peekingduck.declarative_loader INFO: Initialising draw.bbox node...
2021-10-19 11:44:36 peekingduck.declarative_loader INFO: Initialising output.screen node...
/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MetalPerformanceShaders-124.2.1/MPSNDArray/Kernels/MPSNDArrayMultiaryKernel.mm:833: failed assertion `Error: Invalid KernelDAG, inputArray.dataType == DAG->_placeholderOps->at(i)->_outputs->at(0)->_dType (i = 0) failed'
[1] 63447 abort peekingduck run

@ongtw
Copy link
Contributor

ongtw commented Oct 19, 2021

Hmm... interesting. I've never seen this error before. I also checked and don't have the /AppleInternal folder. My ~/Library/Caches also don't have com.apple.xbs. This is confounding...
Looks like we need more test samples for M1 Mac installs.

@leeping-ng leeping-ng changed the title Include instructions to run on M1 Mac Update instructions to run on M1 Mac Oct 26, 2021
@ongtw ongtw changed the title Update instructions to run on M1 Mac PeekingDuck Installation for M1 Mac Big Sur 11.x Dec 22, 2021
@liyier90 liyier90 pinned this issue Jan 4, 2022
@ongtw ongtw changed the title PeekingDuck Installation for M1 Mac Big Sur 11.x PeekingDuck Installation for M1 Mac MacOS Big Sur/Monterey Jan 4, 2022
@ongtw
Copy link
Contributor

ongtw commented Mar 2, 2022

PeekingDuck M1 Mac Installation for macOS Monterey/Big Sur (update 2022-03-02)

Prerequisites

  • Install homebrew
  • Install miniforge: brew install miniforge

Setup Conda Environment

  1. conda create -n pkd python=3.8
  2. conda activate pkd
  3. conda install click colorama opencv openblas pyyaml requests scipy shapely tqdm

Install Tensorflow (macOS Monterey)

  1. conda install -c apple tensorflow-deps==2.7.0
  2. pip install tensorflow-estimator==2.7.0 tensorflow-macos==2.7.0 tensorflow-metal==0.3.0

Install Tensorflow (macOS Big Sur)

  1. conda install -c apple tensorflow-deps==2.6.0
  2. pip install tensorflow-estimator==2.6.0 tensorflow-macos==2.6.0 tensorflow-metal==0.2.0

Install PyTorch (currently CPU-only)

  1. pip install torch torchvision

Install PeekingDuck

  1. pip install peekingduck --no-dependencies

Notes:

  • Apple's Tensorflow build for macOS Monterey now defaults to version 2.8.0. PeekingDuck needs version 2.7.0 to work.
  • Prefer conda install to pip install when installing a new package. Use pip only if the package is unavailable on conda, or the conda package is incompatible with existing ones.

@leeping-ng leeping-ng unpinned this issue Mar 29, 2022
@ongtw
Copy link
Contributor

ongtw commented Mar 29, 2022

For the latest updates, please see
https://peekingduck.readthedocs.io/en/stable/getting_started/03_custom_install.html#apple-silicon-mac

@ongtw ongtw changed the title PeekingDuck Installation for M1 Mac MacOS Big Sur/Monterey PeekingDuck Installation for Apple Silicon Mac macOS Big Sur/Monterey Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants