deepmodeling / deepmd-kit

A deep learning package for many-body potential energy representation and molecular dynamics
https://docs.deepmodeling.com/projects/deepmd/
GNU Lesser General Public License v3.0
1.45k stars 499 forks source link

UserWarning: var_mean(): degrees of freedom is <= 0. Correction should be strictly less than the reduction factor #4064

Open njzjz opened 3 weeks ago

njzjz commented 3 weeks ago
2024-08-19T19:59:51.9926736Z source/tests/universal/pt/model/test_model.py::TestPolarModelPT_(<function DescriptorParamDPA2_concat_True_False_False_True_True_True_True_True_True_False_True_res_avg_norm_True_True_1e-05_True_[]_float64_True_False_False at 0x7fc8c790f920>, <class 'deepmd.pt.model.descriptor.dpa2.DescrptDPA2'>)_(<function FittingParamPolar_[]_float64_0 at 0x7fc8c77e0f40>, <class 'deepmd.pt.model.task.polarizability.PolarFittingNet'>)::test_zero_forward
2024-08-19T19:59:51.9930743Z   /home/runner/work/deepmd-kit/deepmd-kit/source/tests/universal/pt/backend.py:70: UserWarning: var_mean(): degrees of freedom is <= 0. Correction should be strictly less than the reduction factor (input numel divided by output numel). (Triggered internally at ../aten/src/ATen/native/ReduceOps.cpp:1807.)
2024-08-19T19:59:51.9932553Z     output = method(*args, **kwargs)
njzjz commented 3 weeks ago

I am a bit confused here - I don't find var_mean in the code.

wanghan-iapcm commented 3 weeks ago

here i find one https://github.com/deepmodeling/deepmd-kit/blob/d77c075199e75497c847f2477c5be669c3f63b5d/deepmd/pt/model/network/layernorm.py#L99