timeseriesAI / tsai

Time series Timeseries Deep Learning Machine Learning Python Pytorch fastai | State-of-the-art Deep Learning library for Time Series and Sequences in Pytorch / fastai
https://timeseriesai.github.io/tsai/
Apache License 2.0
5.16k stars 644 forks source link

Inference failure in 04_Intro_to_Time_Series_Regression.ipynb #134

Closed meanpenguin closed 3 years ago

meanpenguin commented 3 years ago

Using the link to colab in the documentation site

Installed tsai using: !pip install -Uqq git+https://github.com/timeseriesAI/tsai.git tsai : 0.2.18 fastai : 2.4 fastcore : 1.3.20 torch : 1.9.0+cu102

Everything works until probas, _, preds = learn.get_X_preds(X[splits[1]]) skm.mean_squared_error(y[splits[1]], preds, squared=False)

which returns ` RuntimeError Traceback (most recent call last)

in () ----> 1 probas, _, preds = learn.get_X_preds(X[splits[1]]) 2 skm.mean_squared_error(y[splits[1]], preds, squared=False) 12 frames /usr/local/lib/python3.7/dist-packages/torch/_tensor.py in __torch_function__(cls, func, types, args, kwargs) 1021 1022 with _C.DisableTorchFunction(): -> 1023 ret = func(*args, **kwargs) 1024 return _convert(ret, cls) 1025 RuntimeError: The size of tensor a (42) must match the size of tensor b (24) at non-singleton dimension 1 `
oguiza commented 3 years ago

Hi @meanpenguin, Thanks for raising this issue. There was a small bug in the code that I've just fixed. I've re-run the code in Colab and it works well again.

meanpenguin commented 3 years ago

Worked and confirmed fixed. Thank You!