diff --git a/ppgan/models/base_model.py b/ppgan/models/base_model.py index bc9ea3a6fac34721314b7c46cb2c3546273b08d6..467336b409fd197432a3a8ada93a8520d3e8a498 100644 --- a/ppgan/models/base_model.py +++ b/ppgan/models/base_model.py @@ -95,11 +95,6 @@ class BaseModel(ABC): def get_current_visuals(self): """Return visualization images.""" - # visual_ret = OrderedDict() - # for name in self.visual_names: - # if isinstance(name, str) and hasattr(self, name): - # visual_ret[name] = getattr(self, name) - # return visual_ret return self.visual_items def get_current_losses(self): @@ -117,6 +112,4 @@ class BaseModel(ABC): for net in nets: if net is not None: for param in net.parameters(): - # print('trainable:', param.trainable) param.trainable = requires_grad - # param.stop_gradient = not requires_grad diff --git a/ppgan/models/cycle_gan_model.py b/ppgan/models/cycle_gan_model.py index 4fedec97e9f70d5b8c612ebcdbde1db66388f760..633c6534aaca6678ee34bd25d44aa100ca2c72c1 100644 --- a/ppgan/models/cycle_gan_model.py +++ b/ppgan/models/cycle_gan_model.py @@ -32,19 +32,6 @@ class CycleGANModel(BaseModel): """ super(CycleGANModel, self).__init__(cfg) - # if identity loss is used, we also visualize idt_B=G_A(B) ad idt_A=G_A(B) - # if self.is_train and self.cfg.lambda_identity > 0.0: - # visual_names_A.append('idt_B') - # visual_names_B.append('idt_A') - - # combine visualizations for A and B - # self.visual_names = visual_names_A + visual_names_B - # specify the models you want to save to the disk. - # if self.is_train: - # self.model_names = ['G_A', 'G_B', 'D_A', 'D_B'] - # else: # during test time, only load Gs - # self.model_names = ['G_A', 'G_B'] - # define networks (both Generators and discriminators) # The naming is different from those used in the paper. # Code (vs. paper): G_A (G), G_B (F), D_A (D_Y), D_B (D_X) @@ -84,11 +71,6 @@ class CycleGANModel(BaseModel): parameter_list=self.nets['netD_A'].parameters() + self.nets['netD_B'].parameters()) - # self.optimizers.append(self.optimizer_G) - # self.optimizers.append(self.optimizer_D) - - # self.optimizer_names.extend(['optimizer_G', 'optimizer_D']) - def set_input(self, input): """Unpack input data from the dataloader and perform necessary pre-processing steps.