Update 'pytorch_lightning.metrics' from imported package

78 views Asked by At

Im trying to run the following packages

from pytorch_forecasting import Baseline, TemporalFusionTransformer, TimeSeriesDataSet from pytorch_forecasting.data import GroupNormalizer from pytorch_forecasting.metrics import MAE, SMAPE, PoissonLoss, QuantileLoss from pytorch_forecasting.models.temporal_fusion_transformer.tuning import optimize_hyperparameters*

The bold line gives an error however because of a package it uses:

from pytorch_lightning.metrics import Metric as LightningMetric

As I understand this is because pytorch_lightning.metrics no longer exists and is now torchmetrics. I do not know how I can fix this however, as I cannot edit the pytorch_forecasting module.

Can anyone help me?

I have been in a continuous loop of installing older versions of packages but that just seems to cause one problem after another.

1

There are 1 answers

0
Ruut On

For me it worked to downgrade to optuna version 3.4 and pytorch 2.0.1

pip install torch==2.0.1 pytorch-lightning==2.0.2 pytorch_forecasting==1.0.0 torchaudio==2.0.2 torchdata==0.6.1 torchtext==0.15.2 torchvision==0.15.2 optuna==3.4