sktime / pytorch-forecasting

Time series forecasting with PyTorch
https://pytorch-forecasting.readthedocs.io/
MIT License
4.02k stars 637 forks source link

AttributeError: module 'torch' has no attribute 'logit' #239

Closed Mraghuvaran closed 3 years ago

Mraghuvaran commented 3 years ago

Expected behavior

Actual behavior

However, result was .... I think it has to do with ... because of ...

Code to reproduce the problem

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-271-a127b35d9f4a> in <module>
----> 1 import pytorch_forecasting

C:\ProgramData\Anaconda3\lib\site-packages\pytorch_forecasting\__init__.py in <module>
      2 PyTorch Forecasting package for timeseries forecasting with PyTorch.
      3 """
----> 4 from pytorch_forecasting.data import EncoderNormalizer, GroupNormalizer, TimeSeriesDataSet
      5 from pytorch_forecasting.models import Baseline, DeepAR, NBeats, TemporalFusionTransformer
      6 

C:\ProgramData\Anaconda3\lib\site-packages\pytorch_forecasting\data\__init__.py in <module>
      5 to abstracts the necessary work.
      6 """
----> 7 from pytorch_forecasting.data.encoders import EncoderNormalizer, GroupNormalizer, NaNLabelEncoder, TorchNormalizer
      8 from pytorch_forecasting.data.timeseries import TimeSeriesDataSet, TimeSynchronizedBatchSampler
      9 

C:\ProgramData\Anaconda3\lib\site-packages\pytorch_forecasting\data\encoders.py in <module>
    182 
    183 
--> 184 class TorchNormalizer(BaseEstimator, TransformerMixin):
    185     """
    186     Basic target transformer that can be fit also on torch tensors.

C:\ProgramData\Anaconda3\lib\site-packages\pytorch_forecasting\data\encoders.py in TorchNormalizer()
    191         "log": (torch.log, torch.exp),
    192         "log1p": (torch.log1p, torch.exp),
--> 193         "logit": (torch.logit, torch.sigmoid),
    194         "softplus": (_plus_one, F.softplus),
    195         "relu": (_identity, _clamp_zero),

AttributeError: module 'torch' has no attribute 'logit'

Paste the command(s) you ran and the output. Including a link to a colab notebook will speed up issue resolution. If there was a crash, please include the traceback here. The code used to initialize the TimeSeriesDataSet and model should be also included.

jdb78 commented 3 years ago

What was your PyTorch version? You might have to update.

RaedShabbir commented 3 years ago

Confirmed, updating from torch==1.5.0 to 1.7.1 fixed this.

maciejdomagala commented 3 years ago

Also confirming, after torch update from 1.4.0 to 1.7.0 issue is no more.