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

solve Path error on Windows #1627

Merged
merged 71 commits into from
Aug 28, 2024
Merged
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
575c5a9
begin add gpaw
thangckt Mar 16, 2024
3be325d
Create gpaw.py
thangckt Mar 29, 2024
d3cc70d
Merge pull request #1 from deepmodeling/devel
thangckt Mar 29, 2024
547e13b
Update gpaw.py
thangckt Apr 1, 2024
cfa904b
u
thangckt Apr 1, 2024
946561b
Update arginfo.py
thangckt Apr 2, 2024
11103f5
Merge pull request #2 from deepmodeling/devel
thangckt Apr 2, 2024
0ddbf7c
u
thangckt Apr 2, 2024
0b94ff6
u
thangckt Apr 3, 2024
494b796
u
thangckt Apr 4, 2024
2a58c7e
Merge branch 'devel' of https://github.com/thangckt/dpgen into devel
thangckt Apr 4, 2024
01fbd2f
Merge pull request #4 from deepmodeling/devel
thangckt May 2, 2024
babd77e
modify to use pytorch
thangckt May 5, 2024
28b8a49
option to choose between TF and PT
thangckt May 6, 2024
2822be0
Delete gpaw.py
thangckt May 6, 2024
99efd85
finish add option to select TF/PT
thangckt May 7, 2024
bdecc9f
Merge pull request #5 from deepmodeling/devel
thangckt May 7, 2024
f4f5665
Merge pull request #6 from thangckt/devel
thangckt May 7, 2024
ef1df18
remove GPAW to PR
thangckt May 7, 2024
a1b3ff8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 7, 2024
11dca54
Update simplify.py
thangckt May 7, 2024
a0684ca
Merge branch 'PR' of https://github.com/thangckt/dpgen into PR
thangckt May 7, 2024
220735d
Revert "Merge branch 'PR' of https://github.com/thangckt/dpgen into PR"
thangckt May 7, 2024
8f7f491
reset add GPAW from here
thangckt May 7, 2024
05b2412
u
thangckt May 7, 2024
ed832e8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 7, 2024
af3fc27
Update arginfo.py
thangckt May 7, 2024
8a949d0
u
thangckt May 7, 2024
7def8ef
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 7, 2024
52a9989
Update run.py
thangckt May 7, 2024
0d99ea9
Merge branch 'PR' of https://github.com/thangckt/dpgen into PR
thangckt May 7, 2024
8bdea17
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 7, 2024
67fab2b
Merge branch 'devel' into PR
thangckt May 7, 2024
706146a
Update run.py
thangckt May 8, 2024
e72f4c8
Merge branch 'devel' into PR
thangckt May 8, 2024
30c8c67
Merge pull request #7 from thangckt/PR
thangckt May 8, 2024
98eccb8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 8, 2024
702510c
Update run.py
thangckt May 8, 2024
6ffd1eb
Merge branch 'PR' of https://github.com/thangckt/dpgen into PR
thangckt May 8, 2024
3eb40de
Merge pull request #8 from thangckt/PR
thangckt May 8, 2024
624a48b
Update arginfo.py
thangckt May 8, 2024
8b31b4a
Merge pull request #9 from thangckt/PR
thangckt May 8, 2024
ce7c738
Update arginfo.py
thangckt May 8, 2024
090f209
Update run.py
thangckt May 9, 2024
b41caca
Update run.py
thangckt May 9, 2024
6ceecbf
Update run.py
thangckt May 9, 2024
cb1d971
Update run.py
thangckt May 9, 2024
ae35763
separate GPAW's functions into file lib/gpaw.py
thangckt May 9, 2024
cdcd4ac
Update gpaw.py
thangckt May 9, 2024
c405b55
u
thangckt May 9, 2024
cc20cc0
Update run.py
thangckt May 10, 2024
e6855ad
Update run.py
thangckt May 10, 2024
d5f66f2
Update run.py
thangckt May 10, 2024
4faa79e
Merge pull request #10 from thangckt/add_gpaw
thangckt May 10, 2024
c806566
Merge pull request #11 from deepmodeling/devel
thangckt May 10, 2024
d890ed6
Merge branch 'devel' into devel_tha
thangckt May 19, 2024
cc40957
Merge pull request #13 from thangckt/devel
thangckt May 23, 2024
7efb07e
Merge pull request #22 from thangckt/add_gpaw
thangckt Jun 20, 2024
0ca35ec
Merge pull request #27 from deepmodeling/devel
thangckt Aug 23, 2024
82a23ed
Update run.py
thangckt Aug 27, 2024
9aef0bc
i
thangckt Aug 27, 2024
d16fbbc
u
thangckt Aug 27, 2024
fcbcbc1
Update run.py
thangckt Aug 27, 2024
290253a
Update run.py
thangckt Aug 27, 2024
8bede16
Merge branch 'devel' into devel_original
thangckt Aug 27, 2024
62f40d5
Update run.py
thangckt Aug 27, 2024
dc73a4f
Update run.py
thangckt Aug 27, 2024
a20e84e
Update run.py
thangckt Aug 27, 2024
2707435
Update run.py
thangckt Aug 27, 2024
85ea6de
u
thangckt Aug 27, 2024
3ae18a5
Merge pull request #29 from deepmodeling/devel
thangckt Aug 28, 2024
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
Prev Previous commit
Next Next commit
modify to use pytorch
  • Loading branch information
thangckt committed May 5, 2024
commit babd77ece8750297625f8efd9ea04dd9509fe596
34 changes: 25 additions & 9 deletions dpgen/generator/run.py
Original file line number Diff line number Diff line change
@@ -801,15 +801,20 @@ def run_train(iter_index, jdata, mdata):
elif training_init_frozen_model is not None or training_finetune_model is not None:
forward_files.append(os.path.join("old", "init.pb"))

backward_files = ["frozen_model.pb", "lcurve.out", "train.log"]
if jdata.get("train_backend", "tensorflow") == "tensorflow":
backward_files = ["frozen_model.pb", "lcurve.out", "train.log"]
if jdata.get("dp_compress", False):
backward_files.append("frozen_model_compressed.pb")
elif jdata.get("train_backend", "tensorflow") == "pytorch":
backward_files = ["frozen_model.pth", "lcurve.out", "train.log"]

backward_files += [
"model.ckpt.meta",
"model.ckpt.index",
"model.ckpt.data-00000-of-00001",
"checkpoint",
]
if jdata.get("dp_compress", False):
backward_files.append("frozen_model_compressed.pb")

if not jdata.get("one_h5", False):
init_data_sys_ = jdata["init_data_sys"]
init_data_sys = []
@@ -881,12 +886,18 @@ def post_train(iter_index, jdata, mdata):
return
# symlink models
for ii in range(numb_models):
if not jdata.get("dp_compress", False):
model_name = "frozen_model.pb"
else:
model_name = "frozen_model_compressed.pb"
if jdata.get("train_backend", "tensorflow") == "tensorflow":
if not jdata.get("dp_compress", False):
model_name = "frozen_model.pb"
else:
model_name = "frozen_model_compressed.pb"
ofile = os.path.join(work_path, "graph.%03d.pb" % ii)

elif jdata.get("train_backend", "tensorflow") == "pytorch":
model_name = "frozen_model.pth"
ofile = os.path.join(work_path, "graph.%03d.pth" % ii)

task_file = os.path.join(train_task_fmt % ii, model_name)
ofile = os.path.join(work_path, "graph.%03d.pb" % ii)
if os.path.isfile(ofile):
os.remove(ofile)
os.symlink(task_file, ofile)
@@ -1937,7 +1948,12 @@ def run_md_model_devi(iter_index, jdata, mdata):
run_tasks = [os.path.basename(ii) for ii in run_tasks_]
# dlog.info("all_task is ", all_task)
# dlog.info("run_tasks in run_model_deviation",run_tasks_)
all_models = glob.glob(os.path.join(work_path, "graph*pb"))

if jdata.get("train_backend", "tensorflow") == "tensorflow":
all_models = glob.glob(os.path.join(work_path, "graph*pb"))
elif jdata.get("train_backend", "tensorflow") == "torch":
all_models = glob.glob(os.path.join(work_path, "graph*pth"))

model_names = [os.path.basename(ii) for ii in all_models]

model_devi_engine = jdata.get("model_devi_engine", "lammps")
6 changes: 5 additions & 1 deletion dpgen/simplify/simplify.py
Original file line number Diff line number Diff line change
@@ -186,7 +186,11 @@ def make_model_devi(iter_index, jdata, mdata):
# link the model
train_path = os.path.join(iter_name, train_name)
train_path = os.path.abspath(train_path)
models = glob.glob(os.path.join(train_path, "graph*pb"))
if jdata.get("train_backend", "tensorflow") == "tensorflow":
models = glob.glob(os.path.join(train_path, "graph*pb"))
elif jdata.get("train_backend", "tensorflow") == "torch":
models = glob.glob(os.path.join(train_path, "model*pth"))

for mm in models:
model_name = os.path.basename(mm)
os.symlink(mm, os.path.join(work_path, model_name))