Skip to content

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

Merged
janosh merged 5 commits intomainfrom
fix-gh-168
Jun 21, 2024
Merged

Fix KeyError: 'decay_fraction' and TypeError: Object of type int64 is not JSON serializable#169
janosh merged 5 commits intomainfrom
fix-gh-168

Conversation

@janosh
Copy link
Collaborator

@janosh janosh commented Jun 21, 2024

closes #168

janosh added 3 commits June 21, 2024 11:39
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
@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