salesforce / CoST

PyTorch code for CoST: Contrastive Learning of Disentangled Seasonal-Trend Representations for Time Series Forecasting (ICLR 2022)
BSD 3-Clause "New" or "Revised" License
215 stars 43 forks source link

Error during Evaluation of the model #24

Closed RoMartino closed 10 months ago

RoMartino commented 12 months ago

When I run train.py through Electricity.sh script, after training procedure I get this error: Traceback (most recent call last): File "/content/CoST/train.py", line 110, in <module> out, eval_res = tasks.eval_forecasting(model, data, train_slice, valid_slice, test_slice, scaler, pred_lens, n_covariate_cols, args.max_train_length-1) File "/content/CoST/tasks/forecasting.py", line 70, in eval_forecasting test_pred_inv = scaler.inverse_transform(test_pred) File "/usr/local/lib/python3.10/dist-packages/sklearn/preprocessing/_data.py", line 1034, in inverse_transform X = check_array( File "/usr/local/lib/python3.10/dist-packages/sklearn/utils/validation.py", line 915, in check_array raise ValueError( ValueError: Found array with dim 4. None expected <= 2.

gorold commented 10 months ago

Please see the FAQs in the README

Q: ValueError: Found array with dim 4. StandardScaler expected <= 2.

A: Please install the appropriate package requirements as found in requirements.txt, in particular, scikit_learn==0.24.1.