Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 7 additions & 1 deletion deepmd/pt/train/training.py
Comment thread
ChiahsinChu marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,13 @@ def single_model_finetune(

if init_frz_model is not None:
frz_model = torch.jit.load(init_frz_model, map_location=DEVICE)
self.model.load_state_dict(frz_model.state_dict())
state = frz_model.state_dict()
missing, unexpected = self.model.load_state_dict(state, strict=False)
if missing or unexpected:
log.warning(
"Checkpoint loaded non-strictly. "
f"Missing keys: {missing}, Unexpected keys: {unexpected}"
)

# Get model prob for multi-task
if self.multi_task:
Expand Down
77 changes: 77 additions & 0 deletions source/tests/pt/model/models/se_e2_a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"model": {
"type_map": [
"O",
"H"
],
"descriptor": {
"type": "se_e2_a",
"sel": [
23,
46
],
"rcut_smth": 0.50,
"rcut": 4.00,
"neuron": [
2,
4
],
"resnet_dt": false,
"axis_neuron": 4,
"type_one_side": true,
"seed": 1,
"_comment": " that's all"
},
"fitting_net": {
"neuron": [
120
],
"resnet_dt": true,
"seed": 1,
"_comment": " that's all"
},
"data_stat_nbatch": 20,
"_comment": " that's all"
},
"learning_rate": {
"type": "exp",
"decay_steps": 5000,
"start_lr": 0.001,
"stop_lr": 3.51e-8,
"_comment": "that's all"
},
"loss": {
"type": "ener",
"start_pref_e": 0.02,
"limit_pref_e": 1,
"start_pref_f": 1000,
"limit_pref_f": 1,
"_comment": " that's all"
},
"training": {
"training_data": {
"systems": [
"../data/data_0",
"../data/data_1",
"../data/data_2"
],
"batch_size": 1,
"_comment": "that's all"
},
"validation_data": {
"systems": [
"../data/data_3"
],
"batch_size": 1,
"numb_btch": 3,
"_comment": "that's all"
},
"numb_steps": 100000,
"seed": 10,
"disp_file": "lcurve.out",
"disp_freq": 100,
"save_freq": 10000,
"_comment": "that's all"
},
"_comment": "that's all"
}
Comment thread
ChiahsinChu marked this conversation as resolved.
Loading