提交 f9aa9307 编写于 作者: L LielinJiang

rm unused code

上级 17628bbb
...@@ -95,11 +95,6 @@ class BaseModel(ABC): ...@@ -95,11 +95,6 @@ class BaseModel(ABC):
def get_current_visuals(self): def get_current_visuals(self):
"""Return visualization images.""" """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 return self.visual_items
def get_current_losses(self): def get_current_losses(self):
...@@ -117,6 +112,4 @@ class BaseModel(ABC): ...@@ -117,6 +112,4 @@ class BaseModel(ABC):
for net in nets: for net in nets:
if net is not None: if net is not None:
for param in net.parameters(): for param in net.parameters():
# print('trainable:', param.trainable)
param.trainable = requires_grad param.trainable = requires_grad
# param.stop_gradient = not requires_grad
...@@ -32,19 +32,6 @@ class CycleGANModel(BaseModel): ...@@ -32,19 +32,6 @@ class CycleGANModel(BaseModel):
""" """
super(CycleGANModel, self).__init__(cfg) 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) # define networks (both Generators and discriminators)
# The naming is different from those used in the paper. # 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) # Code (vs. paper): G_A (G), G_B (F), D_A (D_Y), D_B (D_X)
...@@ -84,11 +71,6 @@ class CycleGANModel(BaseModel): ...@@ -84,11 +71,6 @@ class CycleGANModel(BaseModel):
parameter_list=self.nets['netD_A'].parameters() + parameter_list=self.nets['netD_A'].parameters() +
self.nets['netD_B'].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): def set_input(self, input):
"""Unpack input data from the dataloader and perform necessary pre-processing steps. """Unpack input data from the dataloader and perform necessary pre-processing steps.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册