-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用iTransformer遇到问题 #1000
Comments
Hi, thanks for using neuralforecast. Can you include a fully reproducible example of code (a piece of code that I can copy-paste and run standalone on my machine), demonstrating the error? Otherwise it's very difficult for me to help. |
您好,这是完整的代码,麻烦你了 nf = NeuralForecast( nf.fit(df=train_df, val_size=12) nf.save(path=save_path, Y_hat_insample['unique_id'] = Y_hat_insample.index |
不好意思,我又遇到一个新的问题,在进行iTransformer预测时发现torch版本不能低于2.1.0,如果低于会有如下报错 |
Can you upgrade your Pytorch version to the latest version? I think you might have PyTorch 2.0.0 and it seems there is an issue with our code in that version. So upgrading to 2.1+ should fix the issue. |
1、您好,您说的我都已经试过了,如果版本更新到2.1+以上,则无法训练,报错信息我已经粘贴在上述问题中 |
I was able to reproduce the same error and it appears to be the result of not having consistent sample sizes for each unique_id. cchallu explains potential solutions very effectively in #718. I do think some kind of check during training would be helpful. |
@eye4got 您好,非常感谢您提供的建议,您方便告诉一下具体的解决办法么 |
@JKYtydt you need to make every unique_id have the same number of time steps. So you can either: 1) cut all the timeseries down to the same length and/or not include some shorter timeseries, so that they are all say 100 days long; 2) use some kind of interpolation or imputation method to fill missing data so they are all the same length. I honestly switched to using the darts package when I found out that neuralforecast doesn't support multivariate forecasting for TFT models. It is much more flexible when it comes to restrictions like this |
@eye4got 您好,我的这个数据集unique_id是唯一的,也没有缺失值,但是它仍然存在这个报错,且发现这个形状的差别刚好是输入的序列长度,这有什么关联么
|
What happened + What you expected to happen
Traceback (most recent call last):
File "/data/anaconda3/envs/time_py/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 541, in _run_script
exec(code, module.dict)
File "/sdc/jky/llm_demo/pages/1_Training.py", line 90, in
Y_hat_insample = nf.predict_insample(step_size=pred_len)
File "/data/anaconda3/envs/time_py/lib/python3.8/site-packages/neuralforecast/core.py", line 1175, in predict_insample
fcsts[:, col_idx : (col_idx + output_length)] = model_fcsts
ValueError: could not broadcast input array from shape (1404,1) into shape (1440,1)
在进行样本内预测时发生了报错,但是书写代码并没有发现问题
Versions / Dependencies
python=3.8
neuralforecast=1.7.2
Reproduction script
nf = NeuralForecast(
models=[model],
freq=freq
)
Issue Severity
None
The text was updated successfully, but these errors were encountered: