Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,8 @@ def set_trainable(self, layer_regex, model=None, indent=0, verbose=1):
trainable = bool(re.fullmatch(layer_regex, layer_name))
if not trainable:
param[1].requires_grad = False
else: # Fixed this bug. We need to set new parameters to train trainable.
param[1].requires_grad = True

def set_log_dir(self, model_path=None):
"""Sets the model log directory and epoch counter.
Expand Down