Error while calling Trainer.Fit()

I am trying to train a CNN Model. While calling the trainer.fit method, it throws out the following error:

  File "/home/*redacted*/miniconda3/envs/torch-lightning/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 553, in fit
    self._run(model)
  File "/home/*redacted*/miniconda3/envs/torch-lightning/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 850, in _run
    self.config_validator.verify_loop_configurations(model)
  File "/home/*redacted*/miniconda3/envs/torch-lightning/lib/python3.8/site-packages/pytorch_lightning/trainer/configuration_validator.py", line 34, in verify_loop_configurations
    self.__verify_train_loop_configuration(model)
  File "/home/*redacted*/miniconda3/envs/torch-lightning/lib/python3.8/site-packages/pytorch_lightning/trainer/configuration_validator.py", line 49, in __verify_train_loop_configuration
    has_training_step = is_overridden("training_step", model)
  File "/home/ashim/miniconda3/envs/torch-lightning/lib/python3.8/site-packages/pytorch_lightning/utilities/model_helpers.py", line 45, in is_overridden
    raise ValueError("Expected a parent")

There is no additional information except this. Can anyone suggest how I can go about the debugging process?

Seems like I forgot to inherit pl.LightningModule while declaring the model class. Weird that there are no relevant results for this.

With lightning versions 2.0.0, use import lightning.pytorch as pl instead of import pytorch_lightning as pl.

1 Like