UNI icon indicating copy to clipboard operation
UNI copied to clipboard

Weights are saved twice after running the walkthrough notebook: `models--MahmoodLab--UNI` and `models--MahmoodLab--uni`

Open GeorgeBatch opened this issue 1 year ago • 2 comments
trafficstars

Dear authors,

I ran the walkthrough notebook, and the model was downloaded twice (see screenshot).

  1. I get the symbolic link assets/ckpts/vit_large_patch16_224.dinov2.uni_mass100k/pytorch_model.bin pointing to a file in .cache/huggingface/hub/models--MahmoodLab--UNI/.

  2. The other downloaded model is in .cache/huggingface/hub/models--MahmoodLab--uni/

I think there are 2 different places in the code, one with capital letters "UNI" and one with non-capital letters "uni". They do not link to each other since each folder weighs 1.2 GB, while together, they occupy 2.4 GB.

Best wishes, George

Screenshot 2024-03-26 at 15 07 46

GeorgeBatch avatar Mar 26 '24 15:03 GeorgeBatch

Hi @GeorgeBatch - are you still running into this issue? It may be due to the repo being renamed (should be stable now).

Richarizardd avatar May 03 '24 03:05 Richarizardd

@Richarizardd, I think the issue was due to renaming, as you said.

I think it's also because of the inconsistency in the instructions:

  • Automatic download: model = timm.create_model("hf-hub:MahmoodLab/uni", pretrained=True, init_values=1e-5, dynamic_img_size=True)
  • Manual download: hf_hub_download("MahmoodLab/UNI", filename="pytorch_model.bin", local_dir=local_dir, force_download=True)

I tried, and it works now to do the automatic download with capital letters in the name "MahmoodLab/UNI". This way, the naming matches with both the manual download name and the repo link on HuggingFace.

Proposed changes to instructions:

  • HF: https://huggingface.co/MahmoodLab/UNI/commit/dfc730e714a82a9c961f1ff52a85e9d2759d06ca
  • GitHub: https://github.com/mahmoodlab/UNI/pull/34

GeorgeBatch avatar Jul 01 '24 19:07 GeorgeBatch