pytorch - Model_heplers.py in is_overridden > raise ValueError(“Expected a parent”)
I am running on a new remote server a code that used to work on another remote server. I think I setup things in the same way, but when I run my training script, I get this error:
Traceback (most recent call last):
  File &quot;/home/andrea/code/vertikal-machine-learning/source/model/hss_bearing_mk2/hss_bearing_mk2/models/train_model.py&quot;, line 144, in &lt;module&gt;
    seq_len=seq_len, mname=mname)
  File &quot;/home/andrea/code/vertikal-machine-learning/source/model/hss_bearing_mk2/hss_bearing_mk2/models/pytorch_models.py&quot;, line 321, in train_test
    trainer.fit(model, datamodule=dm)
  File &quot;/home/andrea/anaconda3/envs/hss_bearing_mk2/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py&quot;, line 552, in fit
    self._run(model)
  File &quot;/home/andrea/anaconda3/envs/hss_bearing_mk2/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py&quot;, line 849, in _run
    self.config_validator.verify_loop_configurations(model)
  File &quot;/home/andrea/anaconda3/envs/hss_bearing_mk2/lib/python3.7/site-packages/pytorch_lightning/trainer/configuration_validator.py&quot;, line 34, in verify_loop_configurations
    self.__verify_train_loop_configuration(model)
  File &quot;/home/andrea/anaconda3/envs/hss_bearing_mk2/lib/python3.7/site-packages/pytorch_lightning/trainer/configuration_validator.py&quot;, line 49, in __verify_train_loop_configuration
    has_training_step = is_overridden(&quot;training_step&quot;, model)
  File &quot;/home/andrea/anaconda3/envs/hss_bearing_mk2/lib/python3.7/site-packages/pytorch_lightning/utilities/model_helpers.py&quot;, line 45, in is_overridden
    raise ValueError(&quot;Expected a parent&quot;)
ValueError: Expected a parent

Here is the part of code that looks buggy for some reason:
    model = get_model(mname=mname)

    dm = DataModule(
        X_train=X_train,
        y_train=y_train,
        X_val=X_val,
        y_val=y_val,
        X_test=X_test,
        y_test=y_test,
        keys_train=keys_train,
        keys_val=keys_val,
        keys_test=keys_test,
        seq_len=seq_len,
        batch_size=batch_size,
        num_workers=4
    )
    # trainer.logger_connector.callback_metrics
    trainer.fit(model, datamodule=dm)

Is it something related to environment setup? Something overridden by something something??
Can someone point me in the right direction?
EDIT: I tried to run my project locally in a newly created environment and I have the same error.
EDIT 2: My DataModule inherits from LightningDataModule
class DataModule(pl.LightningDataModule):


The problem was that model was inheriting from nn.Module instead of from pl.LightningModule
