Building a CNN model for image recognition
PyTorch Lightning is a versatile framework, which makes training and scaling DL models easy by focusing on building models than writing complex programs. PyTorch Lightning is bundled with many useful features and options for building DL models. Since it is hard to cover all the topics in a single chapter, we will keep exploring different features of PyTorch Lightning in every chapter.
Here are the steps for building an image classifier using a CNN:
- Importing the packages
- Collecting the data
- Preparing the data
- Building the model
- Training the model
- Evaluating the accuracy of the model
Importing the packages
We will get started using the following steps:
- First things first—install and load the necessary packages, as follows:
!pip install torch==1.10.0 torchvision==0.11.1 torchtext==0.11.0 torchaudio==0.10.0 --quiet !pip install pytorch-lightning==1.5.2 --quiet !pip install opendatasets -...