tsai icon indicating copy to clipboard operation
tsai copied to clipboard

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

Open ITP0 opened this issue 2 years ago • 1 comments

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'

ITP0 avatar Aug 10 '23 10:08 ITP0

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

oguiza avatar Sep 03 '23 16:09 oguiza