Skip to content

How to load the model as a PyTorch module? #8

Description

@yuxi-liu-wired

I am trying to load just the downloaded model checkpoint.pth to be used as a PyTorch module in another model. I found it difficult to extract the minimum amount of code necessary to load checkpoint.pth as a PyTorch module.

Specifically, I cannot just run

python main_sim.py --dataset wikiart -a vit_large --pt_style csd --feattype normal --world-size 1 
--dist-url tcp://localhost:6001 -b 128 -j 8 --embed_dir ./embeddings --data-dir <path to WikiArt dataset>
--model_path <path to CSD weights>

because I need to use the module as part of a larger model, not on its own.

Further, there are two discrepancies:

  • It is claimed that the checkpoint.pth available for download is a ViT-L, but it has only 304M parameters, while ViT-L has 428M parameters.
  • The paper says you have finetuned both ViT-B and ViT-L, but there is no ViT-B checkpoint available for download.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions