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

Fix KeyError: 'decay_fraction' and TypeError: Object of type int64 is not JSON serializable #169

Merged
merged 5 commits into from
Jun 21, 2024

Conversation

janosh
Copy link
Collaborator

@janosh janosh commented Jun 21, 2024

closes #168

Loaded model params = 412,525
Traceback (most recent call last):
  File "{path}/trainer_reload.py", line 31, in <module>
    trainer = load_trainer(file_path)
              ^^^^^^^^^^^^^^^^^^^^^^^
  File "{path}/trainer_reload.py", line 25, in load_trainer
    trainer = Trainer.load(trainer_path)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "{path}/lib/python3.11/site-packages/chgnet/trainer/trainer.py", line 545, in load
    trainer = Trainer(model=model, **state["trainer_args"])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "{path}/lib/python3.11/site-packages/chgnet/trainer/trainer.py", line 147, in __init__
    decay_fraction = scheduler_params.pop("decay_fraction")
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'decay_fraction'

#168
…sing trainer.train(save_test_result="test-preds.json")
@janosh janosh added fix Bug fix PRs training Questions and issues about training the model labels Jun 21, 2024
@janosh janosh enabled auto-merge (squash) June 21, 2024 15:42
@janosh janosh merged commit 7c21a94 into main Jun 21, 2024
10 checks passed
@janosh janosh deleted the fix-gh-168 branch June 21, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix PRs training Questions and issues about training the model
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Error when loading trainer state using trainer.load
1 participant