Lab 2 - Train your model
1. Connect to your resources
Import dependencies
import os, random
import azureml
import shutil
import urllib.request
from pathlib import Path
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import AxesGrid
import cv2
import urllib3
import zipfile
from azureml.core.model import Model, InferenceConfig
from azureml.core import Workspace, Datastore, Experiment, Run, Environment, ScriptRunConfig
from azureml.core.compute import ComputeTarget, AmlCompute, AksCompute, ComputeTarget
from azureml.train.dnn import PyTorch
from azureml.widgets import RunDetails
from azureml.core.webservice import Webservice, AksWebservice, AciWebservice
from azureml.core.dataset import Dataset
from azureml.core.resource_configuration import ResourceConfiguration
from azureml.core.conda_dependencies import CondaDependencies
# check core SDK version number
print("Azure ML SDK Version: ", azureml.core.VERSION)
Connect to workspace
Connect to Azure Machine Learning Compute Cluster
Connect to the default datastore

Create an experiment
2. Data
Download the dataset from Github
Unzip the dataset

Preview the dataset

Upload the data to the datastore
Create a dataset from the data in the datastore
Register the dataset
Connect to the dataset
Train the model
Download the training script

Submit the PyTorch estimator
Follow the progress of the run


Register the model

Download and test your model
Download the model
Download test images
Unzip test images
Run the model over the test images

Last updated