Skip to content

torch lr_schedulers not accepted #1

@TomasGadea

Description

@TomasGadea

When instantiating the object WarmUpScheduler and passing e.g. the torch.optim.lr_scheduler.CosineAnnealingLR as in example.py execution fails due to the following error:

Traceback (most recent call last):
  File "test.py", line 26, in <module>
    warmup_scheduler = WarmUpScheduler(optimizer, lr_scheduler,
  File "/Users/tomas.gadea/Desktop/test/env/lib/python3.8/site-packages/warmup_scheduler_pytorch/warmup_module.py", line 52, in __init__
    raise TypeError(f'{type(lr_scheduler).__name__} is not a lr_scheduler in pytorch')
TypeError: CosineAnnealingLR is not a lr_scheduler in pytorch

It does not work for any of the typical torch schedulers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions