Skip to content

Commit

Permalink
Using the ckpt that trained with contrastive learning on the INSECT d…
Browse files Browse the repository at this point in the history
…ataset if available.
  • Loading branch information
zmgong committed Jul 24, 2024
1 parent 03c37d9 commit 3ad0148
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/supervised_fine_tune_bioscan_clip_model_on_insect.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ def main(args: DictConfig) -> None:
unique_species_for_seen = get_unique_species_for_seen(insect_trainval_dataloader)

print("Load model...")

original_model = load_clip_model(args)
checkpoint = torch.load(args.model_config.ckpt_path, map_location='cuda:0')
if hasattr(args.model_config, 'ckpt_trained_with_insect_image_dna_text_path'):
checkpoint = torch.load(args.model_config.ckpt_trained_with_insect_image_dna_text_path, map_location='cuda:0')
else:
checkpoint = torch.load(args.model_config.ckpt_path, map_location='cuda:0')
original_model.load_state_dict(checkpoint)
original_model = original_model.to(device)

Expand Down

0 comments on commit 3ad0148

Please sign in to comment.