Skip to content

Commit

Permalink
runnable on local
Browse files Browse the repository at this point in the history
  • Loading branch information
ZombaSY committed Aug 10, 2022
1 parent cc97b01 commit addcb2a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions experiments/pascal/1464/ours/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dataset: # Required.
type: pascal_semi
train:
data_root: ../../../../data/VOC2012
data_root: /mnt/prj/users/ssy/dataset/pascal
data_list: ../../../../data/splits/pascal/1464/labeled.txt
flip: True
GaussianBlur: False
Expand All @@ -11,7 +11,7 @@ dataset: # Required.
type: rand
size: [513, 513] # crop image with HxW size
val:
data_root: ../../../../data/VOC2012
data_root: /mnt/prj/users/ssy/dataset/pascal
data_list: ../../../../data/splits/pascal/val.txt
crop:
type: center
Expand Down
24 changes: 12 additions & 12 deletions u2pl/models/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,18 +365,18 @@ def resnet101(pretrained=True, **kwargs):
pretrained (bool): If True, returns a model pre-trained on ImageNet
"""
model = ResNet(Bottleneck, [3, 4, 23, 3], **kwargs)
if pretrained:
model_url = model_urls["resnet101"]
state_dict = torch.load(model_url)

missing_keys, unexpected_keys = model.load_state_dict(state_dict, strict=False)
print(
f"[Info] Load ImageNet pretrain from '{model_url}'",
"\nmissing_keys: ",
missing_keys,
"\nunexpected_keys: ",
unexpected_keys,
)
# if pretrained:
# model_url = model_urls["resnet101"]
# state_dict = torch.load(model_url)
#
# missing_keys, unexpected_keys = model.load_state_dict(state_dict, strict=False)
# print(
# f"[Info] Load ImageNet pretrain from '{model_url}'",
# "\nmissing_keys: ",
# missing_keys,
# "\nunexpected_keys: ",
# unexpected_keys,
# )
return model


Expand Down

0 comments on commit addcb2a

Please sign in to comment.