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

[BUG] pt: polar training error: KeyError: 'type' #3582

Closed
njzjz opened this issue Mar 21, 2024 · 0 comments · Fixed by #3584
Closed

[BUG] pt: polar training error: KeyError: 'type' #3582

njzjz opened this issue Mar 21, 2024 · 0 comments · Fixed by #3584
Assignees
Labels
Milestone

Comments

@njzjz
Copy link
Member

njzjz commented Mar 21, 2024

Bug summary

See below.

DeePMD-kit Version

ed831c8

TensorFlow Version

PT v2.2.0+cu121-g8ac9b20d4b0

How did you download the software?

Built from source

Input Files, Running Commands, Error Log, etc.

Traceback (most recent call last):
  File "/home/jz748/anaconda3/bin/dp", line 8, in <module>
    sys.exit(main())
  File "/home/jz748/codes/deepmd-kit/deepmd/main.py", line 807, in main
    deepmd_main(args)
  File "/home/jz748/anaconda3/lib/python3.10/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 347, in wrapper
    return f(*args, **kwargs)
  File "/home/jz748/codes/deepmd-kit/deepmd/pt/entrypoints/main.py", line 304, in main
    train(FLAGS)
  File "/home/jz748/codes/deepmd-kit/deepmd/pt/entrypoints/main.py", line 270, in train
    trainer = get_trainer(
  File "/home/jz748/codes/deepmd-kit/deepmd/pt/entrypoints/main.py", line 187, in get_trainer
    trainer = training.Trainer(
  File "/home/jz748/codes/deepmd-kit/deepmd/pt/train/training.py", line 358, in __init__
    single_model_stat(
  File "/home/jz748/codes/deepmd-kit/deepmd/pt/train/training.py", line 248, in single_model_stat
    _model.compute_or_load_stat(
  File "/home/jz748/codes/deepmd-kit/deepmd/pt/model/model/make_model.py", line 482, in compute_or_load_stat
    return self.atomic_model.compute_or_load_stat(sampled_func, stat_file_path)
  File "/home/jz748/codes/deepmd-kit/deepmd/pt/model/atomic_model/dp_atomic_model.py", line 224, in compute_or_load_stat
    self.fitting_net.compute_output_stats(wrapped_sampler, stat_file_path)
  File "/home/jz748/codes/deepmd-kit/deepmd/pt/model/task/polarizability.py", line 233, in compute_output_stats
    nframs = sampled[sys]["type"].shape[0]
KeyError: 'type'

Steps to Reproduce

cd examples/water_tensor/polar
dp --pt train input_torch.json

Further Information, Files, and Links

No response

@njzjz njzjz added the bug label Mar 21, 2024
@njzjz njzjz added this to the v3.0.0 milestone Mar 21, 2024
@njzjz njzjz linked a pull request Mar 22, 2024 that will close this issue
github-merge-queue bot pushed a commit that referenced this issue Mar 26, 2024
To fix #3582, should merge after #3571.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

2 participants