Run an offline PyTorch transfer learning job with Deep Learning Containers (DLC).
Step 1: Get the data
The sample data is available at a public URL (Download the data) and requires no preparation.
Step 2: Get the training code
The training code is available at a public URL (Download the training code). No development required.
Step 3: Create a job
-
Go to the Create Job page.
-
Log on to the PAI console. In the top navigation bar, select a region. In the upper-right corner, select a workspace, and click Go to DLC.
-
On the Deep Learning Containers (DLC) page, click Create Task.
-
-
On the Create Task page, configure the following parameters. Use default values for other settings.

Parameter
Description
Basic Information
Task Name
Enter the job name, such as torch-sample.
Environment Information
Node Image
Click Alibaba Cloud Image and select a PyTorch image.
Datasets
Mount a custom dataset to save training results. This example uses an OSS dataset. Click Custom Dataset and configure the following parameters:
-
Custom Dataset: Select an existing OSS dataset. Create and manage datasets.
-
Mount Path: Set the path to
/mnt/data/.
Start Command
Enter the following command to download the data and code, run the training job, verify the output, and copy results to the mounted directory.
wget https://pai-public-data.oss-cn-beijing.aliyuncs.com/hol-pytorch-transfer-cv/data.tar.gz && tar -xf ./data.tar.gz && mv ./hymenoptera_data/ ./input && mkdir output && wget https://pai-public-data.oss-cn-beijing.aliyuncs.com/hol-pytorch-transfer-cv/main.py && python main.py -i ./input -o ./output && ls ./output && cp -r ./output /mnt/dataResource Information
Resource Source
Select Public Resources.
Framework
Select PyTorch.
Task Resources
-
Nodes: Set to 1.
-
Instance Type: Click
and select an instance type, such as . If this instance type is unavailable in your region, switch to a supported region. Deep Learning Containers (DLC) lists pay-as-you-go regions.
-
-
Click OK.
You are automatically redirected to the Deep Learning Containers (DLC) page.
Step 4: View job details and logs
-
On the Deep Learning Containers (DLC) page, click the job name.
-
On the job overview page, view Basic Information and Resource Information.
-
Scroll down to the Instance section. In the Actions column, click Log.

-
Output files are stored in the mounted dataset's file system. The following figure shows example output in an OSS bucket. Your results may vary.
