python3 -m venv jenv
source jenv/bin/activate
pip3 install jupyter
Jupyter installs,
as shown below.
pip3 install torch torchvision
The installation succeeds,
as shown below.
jupyter server --generate-config
jupyter server password
Enter your desired password twice.
The password is saved to the configuration file, as shown below.
jupyter notebook
A browser window opens showing a
Jupyter page.
Enter your password and log in, as shown below.
Click "Python 3 (ipykernel)".
In your jupyter notebook, execute this command:
print("Hi")
You should see "Hi",
as shown below.
If jupyter crashes, see this page for instructions to specify the arm64 instruction set manually.
ML 125.1: Jupyter Version
In your jupyter notebook, execute this command:The flag is covered by a green rectangle in the image below.
import torch, os print(torch.__version__) if (torch.backends.mps.is_available()): if (torch.backends.mps.is_built()): print( os.system("jupyter --version") )
Pytorch for Mac M1/M2 with GPU acceleration 2023. Jupyter and VS Code setup for PyTorch included.
Posted 5-20-24