code: def test_resnet18(self):
      pl_model = LightningModule(
          model,
          loss,
          optimizer,
          metrics=[
              torchmetrics.F1Score(
                  "multiclass", num_classes=num_classes
              ),
              torchmetrics.Accuracy(
                  "multiclass", num_classes=num_classes
              ),
          ],
      )
      data_loader = create_data_loader(
          data_dir, batch_size, num_workers, data_transform
      )
      trainer = Trainer(max_epochs=4, log_every_n_steps=1)
      trainer.fit(pl_model, data_loader, data_loader)
      trainer.validate(pl_model, data_loader)
      trainer.test(pl_model, data_loader)
      trainer.predict(pl_model, data_loader)
  
file_path: BigDL/python/nano/test/pytorch/tests/train/trainer/test_lightning.py
imports: import os
  from unittest import TestCase
  import torch
  import torchmetrics
  from torch import nn
  from test.pytorch.utils._train_torch_lightning import create_data_loader, data_transform
  from bigdl.nano.pytorch.lightning import LightningModule
  from bigdl.nano.pytorch import Trainer
  from bigdl.nano.pytorch.vision.models import vision
label_desc: Use image node_id 1 for calling the TestLightningModule obj's underlying member method code with example usage: obj.test_resnet18() without return types