apple / tensorflow_macos

TensorFlow for macOS 11.0+ accelerated using Apple's ML Compute framework.
Other
3.66k stars 308 forks source link

Installation process improvement (with jupyter notebook and pycharm support) [without using conda] #215

Open sedwardsmarsh opened 3 years ago

sedwardsmarsh commented 3 years ago

The provided README instructions aren't clear enough to me for a proper installation. I took @hoytak's advice from this comment on #45 to force the installation script to use the Xcode CLI python3 installation.

This approach works well enough that jupyter notebooks can be run after installing them in the virtual environment generated by install_venv.sh. Additionally, PyCharm can be used with the virtual environment created.

The improved installation process:

  1. Install Xcode Command Line Tools for M1 Macs.
  2. Download the latest tensorflow_macos release.
  3. Run install_venv.sh with the added arguments: --python /usr/bin/python3 -p a. Name the virtual environment, for example: .venv.
  4. Activate the virtual environment: . .venv/bin/activate.

Jupyter notebook installation:

  1. Activate the virtual environment: . .venv/bin/activate.
  2. Install jupyter notebook via pip3 install notebook.

Pycharm setup:

  1. Create a new PyCharm project. a. Select .venv as the virtual environment for the project, which was created in The improved installation process.