Jupyter Notebook Warmup¶

The instructions for this Fundamentals notebook are found on the Lab 1 instructions page. (In general the instructions will be within the notebook itself.)

Environment check¶

Run the following cell to check that your environment is set up properly. If this fails:

  1. Make sure you've run /home/cs/344/setup-cs344.sh on a Terminal, logged off, and logged back in.
  2. If you're using VS Code, make sure you've selected the base kernel (click the Select Kernel or "Python" button in the top-right corner of the notebook window). (do not install ipykernel, unless you're setting up your own system and you know what you're doing)
In [1]:
try:
    import fastai
except ImportError:
    print("installing fastai...")
    !pip install -Uqq fastai

import torch
from fastai.vision.all import *
if torch.cuda.is_available():
    print("Found a GPU")
else:
    print("No GPU.")
No GPU.

On the lab computers, the above code should find a GPU.

Anyone running locally on macOS CPU may need this code; generally you should be using the lab machines or Kaggle/Colab though:

In [2]:
import sys
if sys.platform == "darwin":
    # https://stackoverflow.com/a/64855500/69707
    import os
    os.environ['OMP_NUM_THREADS'] = '1'

Jupyter Notebooks¶

Add your code and Markdown cells here. Delete this cell.