Skip to content

[BUG] dpgen init_bulk failed: ValueError(f"Can't parse Element or Species from {type(obj).__name__}: {obj}.") #1506

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

Closed
denghuilu opened this issue Apr 10, 2024 · 3 comments · Fixed by #1471
Labels
bug Something isn't working

Comments

@denghuilu
Copy link
Member

Bug summary

While executing the init_bulk command as outlined in the documentation at https://bohrium-doc.dp.tech/docs/software/DP-GEN_init/, an unexpected error occurred:

DeepModeling
------------
Version: 0.12.0
Path:    /home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/dpgen

Dependency
------------
     numpy     1.26.4   /home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/numpy
    dpdata     0.2.18   /home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/dpdata
  pymatgen            unknown version or path
     monty  2024.3.31   /home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/monty
       ase     3.22.1   /home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/ase
  paramiko      3.4.0   /home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/paramiko
 custodian  2024.3.12   /home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/custodian

Reference
------------
Please cite:
Yuzhi Zhang, Haidi Wang, Weijie Chen, Jinzhe Zeng, Linfeng Zhang, Han Wang, and Weinan E,
DP-GEN: A concurrent learning platform for the generation of reliable deep learning
based potential energy models, Computer Physics Communications, 2020, 107206.
------------

Description
------------
Traceback (most recent call last):
  File "/home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/pymatgen/core/periodic_table.py", line 1466, in get_el_sp
    return DummySpecies.from_str(obj)  # type: ignore
  File "/home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/pymatgen/core/periodic_table.py", line 1372, in from_str
    return cls(sym, oxi, **properties)
  File "/home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/pymatgen/core/periodic_table.py", line 1280, in __init__
    raise ValueError(f"{symbol} contains {symbol[:idx]}, which is a valid element symbol")
ValueError: Type contains T, which is a valid element symbol

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/denghui/deepmd-kit/venv/bin/dpgen", line 8, in <module>
    sys.exit(main())
  File "/home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/dpgen/main.py", line 255, in main
    args.func(args)
  File "/home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/dpgen/data/gen.py", line 1537, in gen_init_bulk
    make_super_cell(jdata)
  File "/home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/dpgen/data/gen.py", line 318, in make_super_cell
    from_struct = Structure.from_file(from_file)
  File "/home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/pymatgen/core/structure.py", line 2939, in from_file
    struct = cls.from_str(contents, fmt="poscar", primitive=primitive, sort=sort, merge_tol=merge_tol, **kwargs)
  File "/home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/pymatgen/core/structure.py", line 2851, in from_str
    struct = Poscar.from_str(input_string, default_names=False, read_velocities=False, **kwargs).structure
  File "/home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/pymatgen/io/vasp/inputs.py", line 442, in from_str
    struct = Structure(
  File "/home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/pymatgen/core/structure.py", line 3751, in __init__
    super().__init__(
  File "/home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/pymatgen/core/structure.py", line 986, in __init__
    site = PeriodicSite(
  File "/home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/pymatgen/core/sites.py", line 334, in __init__
    species = Composition({get_el_sp(species): 1})  # type: ignore
  File "/home/denghui/deepmd-kit/venv/lib/python3.10/site-packages/pymatgen/core/periodic_table.py", line 1468, in get_el_sp
    raise ValueError(f"Can't parse Element or Species from {type(obj).__name__}: {obj}.")
ValueError: Can't parse Element or Species from str: Type.

DP-GEN Version

0.12.0

Platform, Python Version, Remote Platform, etc

No response

Input Files, Running Commands, Error Log, etc.

Arxiv.zip

Steps to Reproduce

Run

dpgen init_bulk param.json machine.json.

Further Information, Files, and Links

No response

@denghuilu denghuilu added the bug Something isn't working label Apr 10, 2024
@njzjz
Copy link
Member

njzjz commented Apr 10, 2024

Have been fixed in #1471

@njzjz njzjz linked a pull request Apr 10, 2024 that will close this issue
@njzjz
Copy link
Member

njzjz commented Apr 10, 2024

@wanghan-iapcm perhaps release a new version?

@njzjz
Copy link
Member

njzjz commented Apr 10, 2024

v0.12.1 has been released.

@njzjz njzjz closed this as completed Apr 10, 2024
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

Successfully merging a pull request may close this issue.

2 participants