Skip to content

[BUG] dp eval-desc ValueError when deal with deepmd/npy/mixed format contain multiple frames #5176

@QuantumMisaka

Description

@QuantumMisaka

Bug summary

When using dp --pt eval-desc -m DPA-3.1-3M.pt -s ./18 --head OC20Mfor adeepmd/npy/mixed` MultiSystems having multiple frames, the eval-desc process will ValueError

dp --pt eval-desc -m ../DPA-3.1-3M.pt -s 18 --head OC20M
[2026-01-26 22:52:25,695] DEEPMD WARNING To get the best performance, it is recommended to adjust the number of threads by setting the environment variables OMP_NUM_THREADS, DP_INTRA_OP_PARALLELISM_THREADS, and DP_INTER_OP_PARALLELISM_THREADS. See https://deepmd.rtfd.io/parallelism/ for more information.
[2026-01-26 22:52:30,346] DEEPMD WARNING You can use the environment variable DP_INFER_BATCH_SIZE tocontrol the inference batch size (nframes * natoms). The default value is 1024.
[2026-01-26 22:52:31,951] DEEPMD WARNING You can use the environment variable DP_INFER_BATCH_SIZE tocontrol the inference batch size (nframes * natoms). The default value is 1024.
[2026-01-26 22:52:31,952] DEEPMD INFO    # -------output of dp eval_desc------- 
[2026-01-26 22:52:31,952] DEEPMD INFO    # processing system : 18
[2026-01-26 22:52:32,149] DEEPMD INFO    # evaluating descriptors for 83 frames
Traceback (most recent call last):
  File "/home/pku-jianghong/liuzhaoqing/.conda/envs/dpeva-dev/bin/dp", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/pku-jianghong/liuzhaoqing/.conda/envs/dpeva-dev/lib/python3.12/site-packages/deepmd/main.py", line 1020, in main
    deepmd_main(args)
  File "/home/pku-jianghong/liuzhaoqing/.conda/envs/dpeva-dev/lib/python3.12/site-packages/deepmd/entrypoints/main.py", line 78, in main
    eval_desc(**dict_args)
  File "/home/pku-jianghong/liuzhaoqing/.conda/envs/dpeva-dev/lib/python3.12/site-packages/deepmd/entrypoints/eval_desc.py", line 126, in eval_desc
    descriptors = dp.eval_descriptor(
                  ^^^^^^^^^^^^^^^^^^^
  File "/home/pku-jianghong/liuzhaoqing/.conda/envs/dpeva-dev/lib/python3.12/site-packages/deepmd/infer/deep_eval.py", line 528, in eval_descriptor
    descriptor = self.deep_eval.eval_descriptor(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pku-jianghong/liuzhaoqing/.conda/envs/dpeva-dev/lib/python3.12/site-packages/deepmd/pt/infer/deep_eval.py", line 782, in eval_descriptor
    self.eval(
  File "/home/pku-jianghong/liuzhaoqing/.conda/envs/dpeva-dev/lib/python3.12/site-packages/deepmd/pt/infer/deep_eval.py", line 362, in eval
    out = self._eval_func(self._eval_model, numb_test, natoms)(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pku-jianghong/liuzhaoqing/.conda/envs/dpeva-dev/lib/python3.12/site-packages/deepmd/pt/infer/deep_eval.py", line 442, in eval_func
    return self.auto_batch_size.execute_all(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pku-jianghong/liuzhaoqing/.conda/envs/dpeva-dev/lib/python3.12/site-packages/deepmd/utils/batch_size.py", line 208, in execute_all
    n_batch, result = self.execute(execute_with_batch_size, index, natoms)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pku-jianghong/liuzhaoqing/.conda/envs/dpeva-dev/lib/python3.12/site-packages/deepmd/utils/batch_size.py", line 112, in execute
    raise e
  File "/home/pku-jianghong/liuzhaoqing/.conda/envs/dpeva-dev/lib/python3.12/site-packages/deepmd/utils/batch_size.py", line 109, in execute
    n_batch, result = callable(max(batch_nframes, 1), start_index)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pku-jianghong/liuzhaoqing/.conda/envs/dpeva-dev/lib/python3.12/site-packages/deepmd/utils/batch_size.py", line 179, in execute_with_batch_size
    return (end_index - start_index), callable(
                                      ^^^^^^^^^
  File "/home/pku-jianghong/liuzhaoqing/.conda/envs/dpeva-dev/lib/python3.12/site-packages/deepmd/pt/infer/deep_eval.py", line 487, in _eval_model
    coords.reshape([nframes, natoms, 3]).astype(prec),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: cannot reshape array of size 54 into shape (1,1494,3)

DeePMD-kit Version

3.1.2

Backend and its version

Pytorch

How did you download the software?

Built from source

Input Files, Running Commands, Error Log, etc.

18.tar.gz

Steps to Reproduce

using dp --pt eval-desc -m DPA-3.1-3M.pt -s ./18 --head OC20M`

Further Information, Files, and Links

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreproducedThis bug has been reproduced by developers

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions