Skip to content

Commit

Permalink
Bugfix for unfreeze layers
Browse files Browse the repository at this point in the history
Another missed occurrence of "vit" rather than "vt". Also fixed to look for first two characters in name rather than anywhere in name, as per the new standard across the code.

I think I've got all of those cases now!
  • Loading branch information
BWBrook committed Nov 4, 2024
1 parent 07c7a73 commit 79c5cf5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ def build_classifier(config, num_classes, df_size, img_size):
def find_unfreeze_points(model, mname, blocks_to_unfreeze):
block_starts = []
print("\nModel Name =", mname)
if 'cn' in mname.lower():
if 'cn' in mname[:2].lower():
for layer in model.layers:
if 'stages' in layer.name and layer.name.endswith('_downsample_1_conv2d'):
block_starts.append(layer.name)
elif 'en' in mname.lower():
elif 'en' in mname[:2].lower():
for layer in model.layers:
if 'block' in layer.name and layer.name.endswith('_0_conv_pw_conv2d'):
block_starts.append(layer.name)
elif 'vit' in mname.lower():
elif 'vt' in mname[:2].lower():
for layer in model.layers:
if 'blocks' in layer.name and layer.name.endswith('_attn'):
block_starts.append(layer.name)
Expand Down

0 comments on commit 79c5cf5

Please sign in to comment.