Commit cc7d1469 authored by Hubert Nourtel's avatar Hubert Nourtel
Browse files

Fix bug in freezing network layer

parent a45c85e5
......@@ -530,7 +530,11 @@ def get_network(model_opts, local_rank):
# Freeze required layers
for name, param in model.named_parameters():
if name.split(".")[0] in model_opts["reset_parts"]:
if hasattr(model, 'external_model'):
idx_split = 1
else:
idx_split = 0
if name.split(".")[idx_split] in model_opts["freeze_parts"]:
param.requires_grad = False
return model
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment