The YOLO-NAS tutorial details how to use SuperGradients to train the ResNet18 model

In this example, we will use SuperGradients to train a ResNet18 model from scratch on the CIFAR10 image classification dataset. We will also fine-tune the same model through transfer learning with weights pre-trained on the ImageNet dataset.

Quick installation

For this example, the only necessary package is SuperGradient. Installing Super Gradient will also install all the dependencies required to run the code in this example.

pip install super-gradients

1. Experimental setup

First, we will initialize our trainer, which is a SuperGradients Trainer object.

from super_gradients import Trainer

The trainer is responsible for training the model, evaluating test data, making predictions, and saving checkpoints.

To initialize the trainer, an experiment name must be provided. We will also ckpt_root_dirprovide the checkpoint root directory via parameter. In this directory, the log, tensorboard, and checkpoint directories for all experiments will reside. This parameter is optional, if not provided, the "checkpoints" directory is assumed to exist in the project path.

A directory with the name of the experiment will be created as a subdirectory ckpt_root_dirlike this:

ckpt_root_dir
|─── experiment_name_1
│       ckpt_bes

Guess you like

Origin blog.csdn.net/tianqiquan/article/details/132569798