You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
trainer.validate(model, val_dataloaders=dloaders, ckpt_path=None, verbose=True) # set ckpt_path to None
However, if I revert to 1.3.1 (specified here), then an error is thrown as it cannot import lightning from pytorch_lightning.core (see full traceback below).
After some trial and error, I found 1.5.1 works. Perhaps this could be specified in the README?
P.S:
File "/private/home/sgvaze/CIRPLANT/trainval_oscar.py", line 242, in <module>
from _trainval_base import init_main
File "/private/home/sgvaze/CIRPLANT/_trainval_base.py", line 34, in <module>
from pytorch_lightning.core import lightning
File "/private/home/sgvaze/miniconda3/envs/cirr/lib/python3.9/site-packages/pytorch_lightning/__init__.py", line 20, in <module>
from pytorch_lightning import metrics # noqa: E402
File "/private/home/sgvaze/miniconda3/envs/cirr/lib/python3.9/site-packages/pytorch_lightning/metrics/__init__.py", line 15, in <module>
from pytorch_lightning.metrics.classification import ( # noqa: F401
File "/private/home/sgvaze/miniconda3/envs/cirr/lib/python3.9/site-packages/pytorch_lightning/metrics/classification/__init__.py", line 14, in <module>
from pytorch_lightning.metrics.classification.accuracy import Accuracy # noqa: F401
File "/private/home/sgvaze/miniconda3/envs/cirr/lib/python3.9/site-packages/pytorch_lightning/metrics/classification/accuracy.py", line 18, in <module>
from pytorch_lightning.metrics.utils import deprecated_metrics, void
File "/private/home/sgvaze/miniconda3/envs/cirr/lib/python3.9/site-packages/pytorch_lightning/metrics/utils.py", line 22, in <module>
from torchmetrics.utilities.data import get_num_classes as _get_num_classes
ImportError: cannot import name 'get_num_classes' from 'torchmetrics.utilities.data' (/private/home/sgvaze/miniconda3/envs/cirr/lib/python3.9/site-packages/torchmetrics/utilities/data.py)```
The text was updated successfully, but these errors were encountered:
Thanks for pointing it out -- indeed, the PytorchLightning API changes quite frequently. I will add the recommended version as 1.5.1 in README.
As a side note, for the most part, I found that the errors associated with API changes can usually be resolved with minor changes though. In the case of val_dataloaders, I believe the newer versions use the argument dataloaders instead.
Hello, thanks for the great work!
I am trying to run your code, but there are issues with PyTorch Lightning (specifically the API changes very quickly).
If run with the latest version (1.6.5 at the moment), an error is thrown because
val_dataloaders
is not a valid argument for Trainer.validate:CIRPLANT/trainval_oscar.py
Line 271 in 4592c97
However, if I revert to 1.3.1 (specified here), then an error is thrown as it cannot import lightning from pytorch_lightning.core (see full traceback below).
After some trial and error, I found 1.5.1 works. Perhaps this could be specified in the README?
P.S:
The text was updated successfully, but these errors were encountered: