9ba91fa13cbb1e7bc4069e46469b34abb5ca4869,models/base_model.py,BaseModel,load_networks,#BaseModel#Any#,78
Before Change
save_filename = "%s_net_%s.pth" % (which_epoch, name)
save_path = os.path.join(self.save_dir, save_filename)
net = getattr(self, "net" + name)
if len(self.gpu_ids) > 0 and torch.cuda.is_available():
net.module.load_state_dict(torch.load(save_path))
else:
net.load_state_dict(torch.load(save_path))
// print network information
def print_networks(self, verbose):
print("---------- Networks initialized -------------")
for name in self.model_names:
if isinstance(name, str):
After Change
net = net.module
// if you are using PyTorch newer than 0.4 (e.g., built from
// GitHub source), you can remove str() on self.device
state_dict = torch.load(save_path, map_location=str(self.device))
// patch InstanceNorm checkpoints prior to 0.4
for key in state_dict:
self.__patch_instance_norm_state_dict(state_dict, net, key.split("."))
net.load_state_dict(state_dict)
// print network information
def print_networks(self, verbose):
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 6
Instances
Project Name: junyanz/pytorch-CycleGAN-and-pix2pix
Commit Name: 9ba91fa13cbb1e7bc4069e46469b34abb5ca4869
Time: 2018-05-22
Author: tongzhou.wang.1994@gmail.com
File Name: models/base_model.py
Class Name: BaseModel
Method Name: load_networks
Project Name: dPys/PyNets
Commit Name: 4a432c5225262f26517776aa865c4c8428d808ad
Time: 2020-07-22
Author: dpisner@utexas.edu
File Name: pynets/plotting/plot_graphs.py
Class Name:
Method Name: plot_community_conn_mat
Project Name: dPys/PyNets
Commit Name: 4a432c5225262f26517776aa865c4c8428d808ad
Time: 2020-07-22
Author: dpisner@utexas.edu
File Name: pynets/plotting/plot_graphs.py
Class Name:
Method Name: plot_conn_mat