romilbert / samformer

Official implementation of SAMformer, a transformer leveraging Sharpness-Aware Minimization and Channel-Wise Attention for Time Series Forecasting.
MIT License
71 stars 8 forks source link

Fix TypeError: save_additional_metrics() takes 5 positional arguments… #4

Open erickmiller opened 2 months ago

erickmiller commented 2 months ago

… but 8 were given

While running training, using: sh run_script.sh -m transformer -d ETTh1 -u -a

When the code hits the early stopping point, I ran into the error:

Traceback (most recent call last):
  File "/samformer/run.py", line 187, in <module>
    main()
  File "/samformer/run.py", line 184, in main
    save_additional_metrics(model, args, history, test_result, elapsed_training_time, train_data, current_directory, capture_weights_callback)
TypeError: save_additional_metrics() takes 5 positional arguments but 8 were given

Saw the function definition and looked like a quick fix, so went ahead and updated the function call. Tested running training and all worked without any errors.