MCPcopy
hub / github.com/yunjey/stargan / restore_model

Method restore_model

solver.py:98–104  ·  view source on GitHub ↗

Restore the trained generator and discriminator.

(self, resume_iters)

Source from the content-addressed store, hash-verified

96 print("The number of parameters: {}".format(num_params))
97
98 def restore_model(self, resume_iters):
99 """Restore the trained generator and discriminator."""
100 print('Loading the trained models from step {}...'.format(resume_iters))
101 G_path = os.path.join(self.model_save_dir, '{}-G.ckpt'.format(resume_iters))
102 D_path = os.path.join(self.model_save_dir, '{}-D.ckpt'.format(resume_iters))
103 self.G.load_state_dict(torch.load(G_path, map_location=lambda storage, loc: storage))
104 self.D.load_state_dict(torch.load(D_path, map_location=lambda storage, loc: storage))
105
106 def build_tensorboard(self):
107 """Build a tensorboard logger."""

Callers 4

trainMethod · 0.95
train_multiMethod · 0.95
testMethod · 0.95
test_multiMethod · 0.95

Calls

no outgoing calls

Tested by 1

test_multiMethod · 0.76