-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbcffe9
commit 7cfa2a5
Showing
12 changed files
with
503 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
seed: 1234 | ||
tag: lora_distill | ||
log_dir: /home/fus/repos/dreamsim-dev/output/dev | ||
|
||
model_type: 'clip_vitb32' | ||
feat_type: 'embedding' | ||
stride: '32' | ||
use_lora: True | ||
|
||
dataset_root: ./dataset/nights | ||
num_workers: 4 | ||
|
||
lr: 0.0003 | ||
weight_decay: 0.0 | ||
batch_size: 32 | ||
epochs: 15 | ||
margin: 0.05 | ||
|
||
lora_r: 8 | ||
lora_alpha: 16 | ||
lora_dropout: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/home/fus/data/nights |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import torch | ||
from .vision_transformer import vit_base, VisionTransformer | ||
import os | ||
|
||
|
||
def load_synclr_as_dino(patch_size, load_dir="./models", l14=False): | ||
sd = torch.load(os.path.join(load_dir, f'synclr_vit_b_{patch_size}.pth'))['model'] | ||
dino_vit = vit_base(patch_size=patch_size) | ||
new_sd = dict() | ||
|
||
for k, v in sd.items(): | ||
new_key = k[14:] # strip "module.visual" from key | ||
new_sd[new_key] = v | ||
|
||
dino_vit.load_state_dict(new_sd) | ||
return dino_vit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.