chengtan9907 / OpenSTL

OpenSTL: A Comprehensive Benchmark of Spatio-Temporal Predictive Learning
https://openstl.readthedocs.io/en/latest/
Apache License 2.0
730 stars 113 forks source link

scheduler problem #117

Closed oduinihao closed 2 months ago

oduinihao commented 6 months ago

尊敬的作者您好,十分欣赏您的工作! 我在运行taxibj等基于timm导入的scheduler时会出现以下报错:lr scheduler CosineLRScheduler doesn't follow PyTorch's LRScheduler API. You should override the LightningModule.lr_scheduler_step hook with your own logic if you are using a custom LR scheduler. 在openstl/methods/base_method.py中加入commit a6e0dd3中已经删除的函数: def lr_scheduler_step(self, scheduler, *args, **kwargs): scheduler.step(epoch=self.current_epoch) 则能正常运行;但在加入后onecycle学习率则不能正常更新(issue#113以及#99中已经提及)。目前我在运行Onecycle时会注释掉这行代码,但在运行例如cosine等scheduler时则会添加这行代码。

oduinihao commented 6 months ago

目前条件下我对比taxibj或者weather中的log中学习率变化没有发现问题,请问正常情况下应该如何在不反复更改base_method.py的情况下一键运行,

chengtan9907 commented 2 months ago

@oduinihao 非常感谢您报告的这个问题。我在最新的commit中加入了对timm scheduler的判断,应该能解决这个问题了:commit96a1c77