thuml / TimeXer

Official implementation for "TimeXer: Empowering Transformers for Time Series Forecasting with Exogenous Variables" (NeurIPS 2024)
80 stars 8 forks source link

用inverse反归一化报错 #12

Closed AMINUSFELIX closed 3 days ago

AMINUSFELIX commented 4 days ago

Traceback (most recent call last): File "run.py", line 228, in exp.test(setting, test=1) File "G:\PythonProjects\TimeXer-main\exp\exp_long_term_forecasting.py", line 233, in test outputs = test_data.inverse_transform(outputs.squeeze(0)).reshape(shape) ValueError: cannot select an axis to squeeze out which has size not equal to one

按照 https://github.com/thuml/Time-Series-Library/commit/20eff0e 修改后,依然报错:

Traceback (most recent call last): File "run.py", line 228, in exp.test(setting, test=1) File "G:\PythonProjects\TimeXer-main\exp\exp_long_term_forecasting.py", line 231, in test outputs = test_data.inverse_transform(outputs.reshape(shape[0] shape[1], -1)).reshape(shape) File "G:\PythonProjects\TimeXer-main\data_provider\data_loader.py", line 434, in inverse_transform return self.scaler.inverse_transform(data) File "G:\anaconda3\envs\TimeXer\lib\site-packages\sklearn\preprocessing_data.py", line 1052, in inverse_transform X = self.scale_ ValueError: non-broadcastable output operand with shape (96,1) doesn't match the broadcast shape (96,3)

s1h3ibai commented 3 days ago

你好 请问这个问题你解决了吗 ,我也有这个问题

AMINUSFELIX commented 3 days ago

你好 请问这个问题你解决了吗 ,我也有这个问题

我也还没解决

wang-lucy commented 3 days ago

您好,这是由于在数据集归一化时对所有变量进行了归一化,导致在进行MS预测时输出的形状与数据集形状不匹配导致的,我们已经对exp代码进行了更新。感谢您的反馈!