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

hparam_overrides not working #1886

Closed
artidoro opened this issue May 19, 2020 · 3 comments
Closed

hparam_overrides not working #1886

artidoro opened this issue May 19, 2020 · 3 comments
Labels
bug Something isn't working help wanted Open to be worked on

Comments

@artidoro
Copy link

artidoro commented May 19, 2020

🐛 Bug

Error when using hparam_overrides which was recently introduced by: #1797. This is the log:

Traceback (most recent call last):
  File "main.py", line 211, in <module>
    model = RelationEmbeddingModelLit.load_from_checkpoint(
  File "/home/ubuntu/anaconda3/envs/py38/lib/python3.8/site-packages/pytorch_lightning/core/lightning.py", line 1601, in load_from_checkpoint
    update_hparams(hparams, hparam_overrides)
UnboundLocalError: local variable 'hparams' referenced before assignment

To Reproduce

Steps to reproduce the behavior:

  1. Load a checkpoint using the hparam_overrides argument:
MyPLModel.load_from_checkpoint(checkpoint_path, hparam_overrides={key: new_val})

Expected behavior

No bug.

Environment

  • CUDA:
    • GPU:
      • Tesla V100-SXM2-16GB
    • available: True
    • version: 10.1
  • Packages:
    • numpy: 1.18.1
    • pyTorch_debug: False
    • pyTorch_version: 1.4.0
    • pytorch-lightning: 0.7.7-dev
    • tensorboard: 2.2.1
    • tqdm: 4.43.0
  • System:
    • OS: Linux
    • architecture:
      • 64bit
      • ELF
    • processor: x86_64
    • python: 3.8.1
    • version: Errata in the readme? #117-Ubuntu SMP Wed Apr 8 09:52:02 UTC 2020
@artidoro artidoro added bug Something isn't working help wanted Open to be worked on labels May 19, 2020
@github-actions
Copy link
Contributor

Hi! thanks for your contribution!, great first issue!

@williamFalcon
Copy link
Contributor

@artidoro try from master?

@artidoro
Copy link
Author

artidoro commented Jun 9, 2020

Now it works! You might need to clean up the docs for hparam_overrides in the load_from_checkpoint method @williamFalcon.

@artidoro artidoro closed this as completed Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Open to be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants