Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit 12d7c48

Browse files
committed
Change session key name
1 parent 94c059c commit 12d7c48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

train.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def load_session():
153153
print('Use session config instead:')
154154
print(utils.dict2params(model_config))
155155
model_state = sess['model_state']
156-
optimizer_state = sess['optimizer_state']
156+
optimizer_state = sess['model_optimizer_state']
157157
print('Session is loaded from', sess_path)
158158
sess_loaded = True
159159
except:
@@ -194,7 +194,7 @@ def save_model():
194194
print('Saving to', sess_path)
195195
torch.save({'model_config': model_config,
196196
'model_state': model.state_dict(),
197-
'optimizer_state': optimizer.state_dict()}, sess_path)
197+
'model_optimizer_state': optimizer.state_dict()}, sess_path)
198198
print('Done saving')
199199

200200

0 commit comments

Comments
 (0)