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

Cosine Annealing with Warm Restart LR Scheduler recieving an unexpected kwarg T_i #1384

Closed
3 tasks done
turoger opened this issue Apr 3, 2024 · 1 comment · Fixed by #1386
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@turoger
Copy link

turoger commented Apr 3, 2024

Describe the bug

Calling CosineAnnealingWarmRestart as an option in pykeen.pipeline.pipeline results in the following error:

CosineAnnealingWarmRestarts.__init__() got an unexpected keyword argument 'T_i

I think this error is because lr_scheduler_kwargs has initialized a T_i state when T_i is not required to run the scheduler (T_i equal to T_0 at initialization by Torch so no need to pass T_i as part of the state)

How to reproduce

res = pipeline(
    dataset=wn.WN18,
    model="RotatE",
    model_kwargs=dict(embedding_dim=200),
    training_kwargs=dict(num_epochs=5, batch_size=128),
    optimizer="Adam",
    optimizer_kwargs={"lr": 0.01},
    lr_scheduler="CosineAnnealingWarmRestarts",
    lr_scheduler_kwargs={
        "T_0": 10,
    },
)

Environment

Key Value
OS posix
Platform Linux
Release 5.15.0-100-generic
Time Tue Apr 2 21:03:50 2024
Python 3.11.8
PyKEEN 1.10.2
PyKEEN Hash UNHASHED
PyKEEN Branch
PyTorch 2.2.1+cu118
CUDA Available? true
CUDA Version 11.8
cuDNN Version 8700

Additional information

No response

Issue Template Checks

  • This is not a feature request (use a different issue template if it is)
  • This is not a question (use the discussions forum instead)
  • I've read the text explaining why including environment information is important and understand if I omit this information that my issue will be dismissed
@turoger turoger added the bug Something isn't working label Apr 3, 2024
mberr added a commit that referenced this issue May 17, 2024
Fix #1384

Also, do not register an LR scheduler callback if we do not have a
learning rate scheduler, instead of just doing nothing in the callback.

---------

Co-authored-by: Charles Tapley Hoyt <cthoyt@gmail.com>
@mberr
Copy link
Member

mberr commented May 26, 2024

Hi @turoger ,

the issue should be fixed with #1386 being merged to master. It will be included in our next release, but you can already get access by installing from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants