Skip to content

fix a bug in convert_training_data_to_hdf5 #1167

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

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dpgen/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def convert_training_data_to_hdf5(input_files: List[str], h5_file: str):
p1, p2 = pp.split("#")
ff = os.path.normpath(str((dd / p1).absolute().relative_to(cwd)))
pp = ff + "#" + p2
new_pp = os.path.normpath(os.path.relpath(ff, h5_dir)) + "/" + p2
new_pp = os.path.normpath(os.path.relpath(ff, h5_dir)) + p2
else:
pp = os.path.normpath(str((dd / pp).absolute().relative_to(cwd)))
new_pp = os.path.normpath(os.path.relpath(pp, h5_dir))
Expand All @@ -144,7 +144,7 @@ def convert_training_data_to_hdf5(input_files: List[str], h5_file: str):
if "#" in ii:
p1, p2 = ii.split("#")
p1 = os.path.normpath(os.path.relpath(p1, h5_dir))
group = f.create_group(str(p1) + "/" + p2)
group = f.create_group(str(p1) + p2)
s = dpdata.LabeledSystem(ii, fmt="deepmd/hdf5")
s.to("deepmd/hdf5", group)
else:
Expand Down