Model inference using PyTorch

The notebook below follows our recommended inference workflow. This example demonstrates how to do model inference using PyTorch with a pre-trained ResNet-50 model and image files as input data.

The PyTorch Init Script notebook creates an init script named that installs required libraries for PyTorch. If you run on Databricks Runtime 5.1 ML (Beta) or above, you do not need to create the PyTorch init script and configure your cluster with the script.

Before running the Model inference with PyTorch notebook you must:

  1. Prepare distributed data loading.
  2. Configure your FUSE_MOUNT_LOCATION in the notebook.
  3. If you are running Databricks Runtime 5.0 ML (Beta), do the following:
    1. Run the PyTorch Init Script notebook.
    2. Configure a cluster with the init script.

PyTorch init script notebook

Model inference with PyTorch notebook