This commit is contained in:
chenxuanhong committed 2022-04-21 22:39:55 +08:00
1 parent 7ed12d218f
commit 9f3daca179
3 files changed
+6 -12

No files matched your search

-7
View File
@@ -51,13 +51,6 @@ class BaseModel(torch.nn.Module):
save_path = os.path.join(self.save_dir, save_filename)
torch.save(network.state_dict(), save_path)
# helper saving function that can be used by subclasses
def save_network(self, network, network_label, epoch_label, gpu_ids=None):
save_filename = '%s_net_%s.pth' % (epoch_label, network_label)
save_path = os.path.join(self.save_dir, save_filename)
torch.save(network.cpu().state_dict(), save_path)
if len(gpu_ids) and torch.cuda.is_available():
network.cuda()
# helper loading function that can be used by subclasses
def load_network(self, network, network_label, epoch_label, save_dir=''):