-
Notifications
You must be signed in to change notification settings - Fork 648
The error of compressing the model finetuned by DPA-3 #5171
命令行如下,在尝试对DPA-3微调后的模型进行压缩时遇到报错:
(base) sczc382@ln01:(削除) /run/zhoutao/research/co-author/5-single-atoms/model/GDSP-random-162/deepmd_init_geo/L3-A/run/zhoutao/research/co-author/5-single-atoms/model/GDSP-random-162/deepmd_init_geo/L3-A
lex2D-10000-without-zbl$ ls
checkpoint finetune.sh model.ckpt-2000.pt model.ckpt.pt
dpa3.hdf5 input_v2_compat.json model.ckpt-4000.pt out.json
dpa3_v3.1_C142N20_finetune.pth lcurve.out model.ckpt-6000.pt slurm-788949.out
finetune_input.json model.ckpt-10000.pt model.ckpt-8000.pt
(base) sczc382@ln01: (削除ここまで)
lex2D-10000-without-zbl$ dp --pt compress -i dpa3_v3.1_C142N20_finetune.pth -o compress_dpa3_v3.1_C142N20_fine
tune.pth
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月22日 22:42:44,761] DEEPMD INFO DeePMD version: 3.1.0
[2026年01月22日 22:42:45,392] DEEPMD INFO Minimal neighbor distance is not saved in the model, compute it from the training data.
Traceback (most recent call last):
File "/data/home/sczc382/run/deepmd-kit/bin/dp", line 10, in
sys.exit(main())
^^^^^^
File "/data/home/sczc382/run/deepmd-kit/lib/python3.12/site-packages/deepmd/main.py", line 930, in main
deepmd_main(args)
File "/data/home/sczc382/run/deepmd-kit/lib/python3.12/site-packages/torch/distributed/elastic/multiprocessing/errors/init.py", line 355, in wrapper
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/data/home/sczc382/run/deepmd-kit/lib/python3.12/site-packages/deepmd/pt/entrypoints/main.py", line 567, in main
enable_compression(
File "/data/home/sczc382/run/deepmd-kit/lib/python3.12/site-packages/deepmd/pt/entrypoints/compress.py", line 50, in enable_compression
raise ValueError(
ValueError: The model does not have a minimum neighbor distance, so the training script and data must be provided (via -t,--training-script).
All reactions
Replies: 1 comment
The traceback gives the required fix: this frozen model does not contain a stored minimum neighbor distance, so compression needs the training configuration and accessible training data to calculate it.
Use the training JSON that corresponds to the fine-tuned model:
dp --pt compress \ -i dpa3_v3.1_C142N20_finetune.pth \ -o compress_dpa3_v3.1_C142N20_finetune.pth \ -t finetune_input.json
Run the command from a directory where the data paths inside finetune_input.json resolve correctly, or change them to absolute paths. This commonly occurs when training/freezing was performed with --skip-neighbor-stat; the compressor then has to recover the minimum distance from the data. The relevant check is in deepmd/pt/entrypoints/compress.py.
Coding agent: Codex
Codex version: codex-cli 0.149.0
Model: gpt-5.6-sol
Reasoning effort: xhigh