You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When training a dipole model with multiple systems with different numbers of atoms, an error is thrown when trying to merge the arrays in different shapes. Training with a single system or multiple systems with the same number of atoms is fine.
DeePMD-kit Version
DeePMD-kit v3.0.0b5.dev52+g13e247ec
Backend and its version
PyTorch v2.2.1-g6c8c5ad5eaf
How did you download the software?
Built from source
Input Files, Running Commands, Error Log, etc.
Input file (which is adapted from the official example of the water dipole model):
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.
[2024-11-16 14:35:09,752] DEEPMD INFO DeePMD version: 3.0.0b5.dev52+g13e247ec
[2024-11-16 14:35:09,752] DEEPMD INFO Configuration path: mix_data.json
[2024-11-16 14:35:09,763] DEEPMD INFO _____ _____ __ __ _____ _ _ _
[2024-11-16 14:35:09,763] DEEPMD INFO | __ \ | __ \ |\/|| __ \ || (_)||
[2024-11-16 14:35:09,763] DEEPMD INFO |||| ___ ___ ||__) ||\ / ||||| ______ || __ _ ||_
[2024-11-16 14:35:09,763] DEEPMD INFO |||| / _ \ / _ \| ___/ ||\/|||||||______|||/ /||| __|
[2024-11-16 14:35:09,763] DEEPMD INFO ||__||| __/| __/||||||||__|||<||||_
[2024-11-16 14:35:09,763] DEEPMD INFO |_____/ \___|\___||_||_||_||_____/ |_|\_\|_|\__|
[2024-11-16 14:35:09,763] DEEPMD INFO Please read and cite:
[2024-11-16 14:35:09,763] DEEPMD INFO Wang, Zhang, Han and E, Comput.Phys.Comm. 228, 178-184 (2018)
[2024-11-16 14:35:09,763] DEEPMD INFO Zeng et al, J. Chem. Phys., 159, 054801 (2023)
[2024-11-16 14:35:09,763] DEEPMD INFO See https://deepmd.rtfd.io/credits/ for details.
[2024-11-16 14:35:09,763] DEEPMD INFO --------------------------------------------------------------------------------------------------------
[2024-11-16 14:35:09,763] DEEPMD INFO installed to: /home/jxzhu/apps/miniconda3/envs/deepmd-devel/lib/python3.10/site-packages/deepmd
[2024-11-16 14:35:09,763] DEEPMD INFO /home/jxzhu/apps/deepmd/devel/deepmd
[2024-11-16 14:35:09,763] DEEPMD INFO source: v3.0.0b4-52-g13e247ec
[2024-11-16 14:35:09,763] DEEPMD INFO source branch: devel
[2024-11-16 14:35:09,763] DEEPMD INFO source commit: 13e247ec
[2024-11-16 14:35:09,763] DEEPMD INFO source commit at: 2024-10-26 18:25:18 +0000
[2024-11-16 14:35:09,763] DEEPMD INFO use float prec: double
[2024-11-16 14:35:09,763] DEEPMD INFO build variant: cuda
[2024-11-16 14:35:09,763] DEEPMD INFO Backend: PyTorch
[2024-11-16 14:35:09,763] DEEPMD INFO PT ver: v2.2.1-g6c8c5ad5eaf
[2024-11-16 14:35:09,763] DEEPMD INFO Enable custom OP: False
[2024-11-16 14:35:09,763] DEEPMD INFO running on: jxzhu
[2024-11-16 14:35:09,763] DEEPMD INFO computing device: cuda:0
[2024-11-16 14:35:09,763] DEEPMD INFO CUDA_VISIBLE_DEVICES: unset
[2024-11-16 14:35:09,763] DEEPMD INFO Count of visible GPUs: 1
[2024-11-16 14:35:09,763] DEEPMD INFO num_intra_threads: 0
[2024-11-16 14:35:09,763] DEEPMD INFO num_inter_threads: 0
[2024-11-16 14:35:09,763] DEEPMD INFO --------------------------------------------------------------------------------------------------------
[2024-11-16 14:35:09,803] DEEPMD INFO Calculate neighbor statistics... (add --skip-neighbor-stat to skip this step)
[2024-11-16 14:35:10,054] DEEPMD INFO Adjust batch size from 1024 to 2048
[2024-11-16 14:35:10,145] DEEPMD INFO Adjust batch size from 2048 to 4096
[2024-11-16 14:35:10,232] DEEPMD INFO Adjust batch size from 4096 to 8192
[2024-11-16 14:35:10,444] DEEPMD INFO Adjust batch size from 8192 to 16384
[2024-11-16 14:35:10,653] DEEPMD INFO Adjust batch size from 16384 to 32768
[2024-11-16 14:35:10,866] DEEPMD INFO Adjust batch size from 32768 to 16384
[2024-11-16 14:35:11,127] DEEPMD INFO training data with min nbor dist: 0.999890527057838
[2024-11-16 14:35:11,127] DEEPMD INFO training data with max nbor size: [20 36]
[2024-11-16 14:35:11,146] DEEPMD INFO Packing data for statistics from 3 systems
Traceback (most recent call last):
File "/home/jxzhu/apps/miniconda3/envs/deepmd-devel/bin/dp", line 8, in<module>sys.exit(main())
File "/home/jxzhu/apps/deepmd/devel/deepmd/main.py", line 927, in main
deepmd_main(args)
File "/home/jxzhu/apps/miniconda3/envs/deepmd-devel/lib/python3.10/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 347, in wrapper
return f(*args, **kwargs)
File "/home/jxzhu/apps/deepmd/devel/deepmd/pt/entrypoints/main.py", line 527, in main
train(
File "/home/jxzhu/apps/deepmd/devel/deepmd/pt/entrypoints/main.py", line 339, in train
trainer = get_trainer(
File "/home/jxzhu/apps/deepmd/devel/deepmd/pt/entrypoints/main.py", line 191, in get_trainer
trainer = training.Trainer(
File "/home/jxzhu/apps/deepmd/devel/deepmd/pt/train/training.py", line 293, in __init__
self.get_sample_func = single_model_stat(
File "/home/jxzhu/apps/deepmd/devel/deepmd/pt/train/training.py", line 233, in single_model_stat
_model.compute_or_load_stat(
File "/home/jxzhu/apps/deepmd/devel/deepmd/pt/model/model/make_model.py", line 573, in compute_or_load_stat
return self.atomic_model.compute_or_load_stat(sampled_func, stat_file_path)
File "/home/jxzhu/apps/deepmd/devel/deepmd/pt/model/atomic_model/dp_atomic_model.py", line 294, in compute_or_load_stat
self.compute_or_load_out_stat(wrapped_sampler, stat_file_path)
File "/home/jxzhu/apps/deepmd/devel/deepmd/pt/model/atomic_model/base_atomic_model.py", line 396, in compute_or_load_out_stat
self.change_out_bias(
File "/home/jxzhu/apps/deepmd/devel/deepmd/pt/model/atomic_model/base_atomic_model.py", line 463, in change_out_bias
bias_out, std_out = compute_output_stats(
File "/home/jxzhu/apps/deepmd/devel/deepmd/pt/utils/stat.py", line 367, in compute_output_stats
bias_atom_a, std_atom_a = compute_output_stats_atomic(
File "/home/jxzhu/apps/deepmd/devel/deepmd/pt/utils/stat.py", line 550, in compute_output_stats_atomic
merged_output = {
File "/home/jxzhu/apps/deepmd/devel/deepmd/pt/utils/stat.py", line 551, in<dictcomp>
kk: to_numpy_array(torch.cat(outputs[kk]))
File "/home/jxzhu/apps/miniconda3/envs/deepmd-devel/lib/python3.10/site-packages/torch/utils/_device.py", line 77, in __torch_function__
return func(*args, **kwargs)
RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 702 but got size 864 fortensor number 1in the list.
Steps to Reproduce
mkdir test&&cdtest
wget -c https://github.com/user-attachments/files/17783779/test-data.tar.gz
tar -zxvf test-data.tar.gz
# get input.json file
dp --pt train input.json
My guess is that at line 550 we are concatenating tensor labels of shape [nframe, nloc * ndim]. This will fail because for the first system, there are 234 atoms each has a dipole lable of shape 3 (hence 702) and for the second system the number of atom is 288.
Bug summary
When training a dipole model with multiple systems with different numbers of atoms, an error is thrown when trying to merge the arrays in different shapes. Training with a single system or multiple systems with the same number of atoms is fine.
DeePMD-kit Version
DeePMD-kit v3.0.0b5.dev52+g13e247ec
Backend and its version
PyTorch v2.2.1-g6c8c5ad5eaf
How did you download the software?
Built from source
Input Files, Running Commands, Error Log, etc.
Input file (which is adapted from the official example of the water dipole model):
Running command:
Error log:
Steps to Reproduce
Further Information, Files, and Links
test-data.tar.gz
The text was updated successfully, but these errors were encountered: