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
4.92k stars 622 forks source link

Is it because the new version of torch does not have the attribute "asarray"? #816

Open ITP0 opened 11 months ago

ITP0 commented 11 months ago

When I use the "TSForecast" method, an error occurs

Traceback (most recent call last): File "<pyshell#19>", line 1, in TSForecaster(X, y, splits=splits, arch='PatchTST', arch_config=arch_config, metrics=mse) File "C:\Users\86152\AppData\Local\Programs\Python\Python39\lib\site-packages\tsai-0.3.8-py3.9.egg\tsai\tslearner.py", line 206, in init dls = get_ts_dls(X, y=y, splits=splits, sel_vars=sel_vars, sel_steps=sel_steps, tfms=tfms, inplace=inplace, File "C:\Users\86152\AppData\Local\Programs\Python\Python39\lib\site-packages\tsai-0.3.8-py3.9.egg\tsai\data\core.py", line 1095, in get_ts_dls dsets = TSDatasets(X, y, splits=splits, sel_vars=sel_vars, sel_steps=sel_steps, tfms=tfms, inplace=inplace) File "C:\Users\86152\AppData\Local\Programs\Python\Python39\lib\site-packages\tsai-0.3.8-py3.9.egg\tsai\data\core.py", line 491, in init tl.items = typ(tl.items) File "C:\Users\86152\AppData\Local\Programs\Python\Python39\lib\site-packages\tsai-0.3.8-py3.9.egg\tsai\data\core.py", line 75, in new o = torch.asarray(o, dtype=dtype, device=device, copy=copy, requires_grad=requires_grad) AttributeError: module 'torch' has no attribute 'asarray'

oguiza commented 10 months ago

Hi @ITP0, I'm not sure what tsai version and torch version you are using. But the new version of torch >=2.0 has asarray: https://pytorch.org/docs/stable/generated/torch.asarray.html