QData / spacetimeformer

Multivariate Time Series Forecasting with efficient Transformers. Code for the paper "Long-Range Transformers for Dynamic Spatiotemporal Forecasting."
https://arxiv.org/abs/2109.12218
MIT License
808 stars 191 forks source link

Misconfiguration Exception #38

Closed AlfredT15 closed 2 years ago

AlfredT15 commented 2 years ago

Hello,

I am trying to run your model and followed the steps provided for preparing the environment. I then tried to use the cli provided and with each operation, I would run into an error of

Traceback (most recent call last): File "train.py", line 447, in <module> main(args) File "train.py", line 432, in main trainer.fit(forecaster, datamodule=data_module) File "/home/alfred/anaconda3/envs/spacetimeformer/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 768, in fit self._call_and_handle_interrupt( File "/home/alfred/anaconda3/envs/spacetimeformer/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 721, in _call_and_handle_interrupt return trainer_fn(*args, **kwargs) File "/home/alfred/anaconda3/envs/spacetimeformer/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 809, in _fit_impl results = self._run(model, ckpt_path=self.ckpt_path) File "/home/alfred/anaconda3/envs/spacetimeformer/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1234, in _run results = self._run_stage() File "/home/alfred/anaconda3/envs/spacetimeformer/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1321, in _run_stage return self._run_train() File "/home/alfred/anaconda3/envs/spacetimeformer/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1351, in _run_train self.fit_loop.run() File "/home/alfred/anaconda3/envs/spacetimeformer/lib/python3.8/site-packages/pytorch_lightning/loops/base.py", line 204, in run self.advance(*args, **kwargs) File "/home/alfred/anaconda3/envs/spacetimeformer/lib/python3.8/site-packages/pytorch_lightning/loops/fit_loop.py", line 269, in advance self._outputs = self.epoch_loop.run(self._data_fetcher) File "/home/alfred/anaconda3/envs/spacetimeformer/lib/python3.8/site-packages/pytorch_lightning/loops/base.py", line 204, in run self.advance(*args, **kwargs) File "/home/alfred/anaconda3/envs/spacetimeformer/lib/python3.8/site-packages/pytorch_lightning/loops/epoch/training_epoch_loop.py", line 246, in advance self.trainer._logger_connector.update_train_step_metrics() File "/home/alfred/anaconda3/envs/spacetimeformer/lib/python3.8/site-packages/pytorch_lightning/trainer/connectors/logger_connector/logger_connector.py", line 197, in update_train_step_metrics self._log_gpus_metrics() File "/home/alfred/anaconda3/envs/spacetimeformer/lib/python3.8/site-packages/pytorch_lightning/trainer/connectors/logger_connector/logger_connector.py", line 225, in _log_gpus_metrics self.trainer.lightning_module.log( File "/home/alfred/anaconda3/envs/spacetimeformer/lib/python3.8/site-packages/pytorch_lightning/core/lightning.py", line 366, in log raise MisconfigurationException( pytorch_lightning.utilities.exceptions.MisconfigurationException: You are trying toself.log()but it is not managed by the "Trainer" control flow

I tried fruitlessly to debug it and was wondering if you had any insight.

Thank you!

AlfredT15 commented 2 years ago

I fixed the issue! It was a problem with pytorch-lightning version 1.6+.

I downgraded to 1.5 and it worked