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

dpgen autotest encounter an error "assert( len(data['atom_names'])==len(data['atom_numbs']) )" #680

Closed
xwchen2019 opened this issue Mar 23, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@xwchen2019
Copy link

Summary

I used "dpgen autotest run param machine" to run the eos task, and it goes well. Then I use "dpgen autotest post param" to get the eos results, and encounter an error "assert( len(data['atom_names'])==len(data['atom_numbs']) )"
my param file is as below

{
"structures": ["confs"],
"interaction": {
"type": "vasp",
"incar": "relax_incar",
"potcar_prefix":"./",
"potcars": {"Mg": "POTCAR_Mg"}

},
"properties": [
	{
        "type":         "eos",
		"vol_start":	0.9,
		"vol_end":	1.1,
		"vol_step":	0.01,
        "change_box":   true
	}
    ]

}

DPGEN Version and Platform
dpgen version: 0.10.3.dev1+g02037ad.d20211031
platform:centos7

Job submission and computing cluster configuration

Expected Behavior

Actual Behavior

Steps to Reproduce

Further Information, Files, and Links

@xwchen2019 xwchen2019 added the bug Something isn't working label Mar 23, 2022
@AnguseZhang
Copy link
Collaborator

AnguseZhang commented Mar 23, 2022

What's the number of atom types in confs/POSCAR ?

@xwchen2019
Copy link
Author

only one type of atom in confs/POSCAR. Below is the POSCAR file
Mg
1.0
3.0997561 0.0000000 0.0000000
-1.0332520 2.9224780 0.0000000
-1.0332520 -1.4612390 2.5309402
Mg
1
Direct
0.00000 0.00000 0.00000

@xwchen2019
Copy link
Author

I check the results_task.json file (part of it is showing below), it seems that the atom_names is empty,
{
"@module": "dpdata.system",
"@Class": "LabeledSystem",
"data": {
"atom_numbs": [
1
],
"atom_names": [],
"atom_types": {
"@module": "numpy",
"@Class": "array",
"dtype": "int64",
"data": [
0
]
},

@AnguseZhang
Copy link
Collaborator

I did not find assert( len(data['atom_names'])==len(data['atom_numbs']) ) in the current devel branch. Could you please use the latest devel branch, and try again? If there is still problem, you can post the complete traceback.

@xwchen2019
Copy link
Author

HI, Zhang, thanks for your reply. I re-install the dpgen, the dpgen version is 0.10.0 and try it again. i got the same error

Traceback (most recent call last):
File "/home/customer/.conda/envs/deepmd/bin/dpgen", line 8, in
sys.exit(main())
File "/home/customer/.conda/envs/deepmd/lib/python3.9/site-packages/dpgen/main.py", line 175, in main
args.func(args)
File "/home/customer/.conda/envs/deepmd/lib/python3.9/site-packages/dpgen/auto_test/run.py", line 57, in gen_test
run_task(args.TASK, args.PARAM, args.MACHINE)
File "/home/customer/.conda/envs/deepmd/lib/python3.9/site-packages/dpgen/auto_test/run.py", line 48, in run_task
post_property(confs, property_list)
File "/home/customer/.conda/envs/deepmd/lib/python3.9/site-packages/dpgen/auto_test/common_prop.py", line 259, in post_property
prop.compute(os.path.join(path_to_work, 'result.json'), os.path.join(path_to_work, 'result.out'),
File "/home/customer/.conda/envs/deepmd/lib/python3.9/site-packages/dpgen/auto_test/Property.py", line 108, in compute
res, ptr = self._compute_lower(output_file, task_dirs, all_res)
File "/home/customer/.conda/envs/deepmd/lib/python3.9/site-packages/dpgen/auto_test/EOS.py", line 171, in compute_lower
task_result = loadfn(all_res[ii])
File "/home/customer/.conda/envs/deepmd/lib/python3.9/site-packages/monty/serialization.py", line 89, in loadfn
return json.load(fp, *args, **kwargs)
File "/home/customer/.conda/envs/deepmd/lib/python3.9/json/init.py", line 293, in load
return loads(fp.read(),
File "/home/customer/.conda/envs/deepmd/lib/python3.9/json/init.py", line 359, in loads
return cls(**kw).decode(s)
File "/home/customer/.conda/envs/deepmd/lib/python3.9/site-packages/monty/json.py", line 439, in decode
return self.process_decoded(d)
File "/home/customer/.conda/envs/deepmd/lib/python3.9/site-packages/monty/json.py", line 408, in process_decoded
return cls
.from_dict(data)
File "/home/customer/.conda/envs/deepmd/lib/python3.9/site-packages/monty/json.py", line 181, in from_dict
return cls(**decoded)
File "/home/customer/.conda/envs/deepmd/lib/python3.9/site-packages/dpdata/system.py", line 1181, in init
check_LabeledSystem(data)
File "/home/customer/.conda/envs/deepmd/lib/python3.9/site-packages/dpdata/system.py", line 1859, in check_LabeledSystem
assert( len(data['atom_names'])==len(data['atom_numbs']) )
AssertionError

@njzjz
Copy link
Member

njzjz commented Nov 5, 2023

The issue should have been fixed by deepmodeling/dpdata#151, or might be the same issue as deepmodeling/dpdata#359. The error happens with dpdata, and there is no error with dpgen.

@njzjz njzjz closed this as completed Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants