update
This commit is contained in:
@@ -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=''):
|
||||
|
||||
Reference in New Issue
Block a user