Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scheduler problem #117

Closed
oduinihao opened this issue Mar 19, 2024 · 2 comments
Closed

scheduler problem #117

oduinihao opened this issue Mar 19, 2024 · 2 comments

Comments

@oduinihao
Copy link

尊敬的作者您好,十分欣赏您的工作!
我在运行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
Copy link
Author

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

@chengtan9907
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants