NameError: name 'pl' is not defined in PyTorch Lightning

Ask Questions Forum: ask Machine Learning Questions to our readersCategory: PyTorchNameError: name 'pl' is not defined in PyTorch Lightning
Chris Staff asked 1 month ago

What is the cause of this error? I am creating a model with PyTorch Lightning.

Traceback (most recent call last):
  File "classic.py", line 32, in 
    pl.seed_everything(42)
NameError: name 'pl' is not defined

1 Answers
Best Answer
Chris Staff answered 1 month ago

It means that PyTorch Lightning was not imported. Import it as follows (before calling pl) and it will work.

import pytorch_lightning as pl

Your Answer

6 + 6 =