Skip to content

Commit

Permalink
changed model weight s3 paths to new brain-score AWS bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-ferguson committed Nov 18, 2024
1 parent f3b5e63 commit 45060b3
Show file tree
Hide file tree
Showing 8 changed files with 156 additions and 156 deletions.
4 changes: 2 additions & 2 deletions brainscore_vision/models/cornet_s/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def __init__(self, model):
model_ctr = getattr(mod, 'CORnet_S')
model = model_ctr()
model = Wrapper(model) # model was wrapped with DataParallel, so weights require `module.` prefix
weights_path = load_weight_file(bucket="brainscore-vision", folder_name="models",
weights_path = load_weight_file(bucket="brainscore-storage", folder_name="brainscore-vision/models",
relative_path="cornet_s/cornet_s_epoch43.pth.tar",
version_id="4EAQnCqTy.2MCKiXTJ4l02iG8l3e.yfQ",
version_id="null",
sha1="a4bfd8eda33b45fd945da1b972ab0b7cad38d60f")
checkpoint = torch.load(weights_path, map_location=lambda storage, loc: storage) # map onto cpu
model.load_state_dict(checkpoint['state_dict'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def load_preprocess_custom_model(image_filepaths, image_size, **kwargs):
def get_model(name):
assert name == 'custom_model_cv_18_dagger_408'
model = create_model('crossvit_18_dagger_408', pretrained=False)
weights_path = load_weight_file(bucket="brainscore-vision", folder_name="models",
weights_path = load_weight_file(bucket="brainscore-storage", folder_name="brainscore-vision/models",
relative_path="custom_model_cv_18_dagger_408/crossvit_18_dagger_408_adv_finetuned_epoch5.pt",
version_id="pQVPFC_iiWpRRr7P54qxQfRzjNSn2uYB",
version_id="null",
sha1="c769518485e352d5a2e6f3e588d6208cbad71b69")
checkpoint = torch.load(weights_path, map_location=torch.device('cpu'))
model.load_state_dict(checkpoint['state_dict'], strict=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ def get_model(name):
assert name == 'effnetb1_cutmix_augmix_sam_e1_5avg_424x377'
model_tf_efficientnet_b1_ns = EffNetBX()

weights_path = load_weight_file(bucket="brainscore-vision", folder_name="models",
weights_path = load_weight_file(bucket="brainscore-storage", folder_name="brainscore-vision/models",
relative_path="effnetb1_cutmix_augmix_sam_e1_5avg_424x377/weights1_5_avg.pth",
version_id="EqB6P7BittVdkgRd3oMncq_j9AAdiYvz",
version_id="null",
sha1="871bd10e6ce164bfe8f3ce10bb77a69d326d7b65")
model_tf_efficientnet_b1_ns.load_state_dict(torch.load(weights_path, map_location=torch.device('cpu'))["model"])
model = model_tf_efficientnet_b1_ns.efnet_model
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def forward(self, x):
def get_model(name):
assert name == 'effnetb1_cutmixpatch_augmix_robust32_avge4e7_manylayers_324x288'
model_tf_efficientnet_b1_ns = EffNetBX()
weights_path = load_weight_file(bucket="brainscore-vision", folder_name="models",
weights_path = load_weight_file(bucket="brainscore-storage", folder_name="brainscore-vision/models",
relative_path="effnetb1_cutmixpatch_augmix_robust32_avge4e7_manylayers_324x288/tf_efficientnet_b1_ns_robust_cutmixpatchresize_augmix_e4toe7.pth",
version_id="iB0UqbguDpYHD0HRbMt1F1er3c414yWr",
version_id="null",
sha1="37f3ac1b14e80cfaa99fa5f412c1e132480ed5b6")

model_tf_efficientnet_b1_ns.load_state_dict(torch.load(weights_path,map_location=torch.device('cpu'))["model"])
Expand Down
4 changes: 2 additions & 2 deletions brainscore_vision/models/hmax/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def get_model(name):


def get_hmax(identifier, image_size):
weights_path = load_weight_file(bucket="brainscore-vision", folder_name="models",
weights_path = load_weight_file(bucket="brainscore-storage", folder_name="brainscore-vision/models",
relative_path="hmax/universal_patch_set.mat",
version_id="fIX.lsvnc8qqjDr_sG_Dl9RyqWuG0OGC",
version_id="null",
sha1="acc7316fcb0d1797486bb62753b71e158216a92a")
global model
model = HMAX(str(weights_path))
Expand Down
4 changes: 2 additions & 2 deletions brainscore_vision/models/resnet_50_robust/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def get_model(name):
model_ctr = getattr(module, 'resnet50')
model = model_ctr()
preprocessing = functools.partial(load_preprocess_images, image_size=224)
weights_path = load_weight_file(bucket="brainscore-vision", folder_name="models",
weights_path = load_weight_file(bucket="brainscore-storage", folder_name="brainscore-vision/models",
relative_path="resnet-50-robust/ImageNet.pt",
version_id=".shHB0L_L9L3Mtco0Kf4EBP3Xj9nLKnC",
version_id="null",
sha1="cc6e4441abc8ad6d2f4da5db84836e544bfb53fd")
checkpoint = torch.load(weights_path, map_location=torch.device('cpu'))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def get_model_from_s3():
model_arch = 'resnet50'
pretrained = True
if pretrained and model_arch:
weights_path = load_weight_file(bucket="brainscore-vision", folder_name="models",
weights_path = load_weight_file(bucket="brainscore-storage", folder_name="brainscore-vision/models",
relative_path="voneresnet-50-non_stochastic/voneresnet50_ns_e70.pth.tar",
version_id="vDk2cwi2xjwGqhGyyjp8lEGSfcaFzB61",
version_id="null",
sha1="c270528818d6d7fc67a6aec86919d47311ad6221")
ckpt_data = torch.load(weights_path, map_location=torch.device('cpu'))
stride = ckpt_data['flags']['stride']
Expand Down

0 comments on commit 45060b3

Please sign in to comment.