Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Error when downloading dinov2_* zoo models #3686

Closed
2 of 7 tasks
swheaton opened this issue Oct 18, 2023 · 1 comment · Fixed by #3690
Closed
2 of 7 tasks

[BUG] Error when downloading dinov2_* zoo models #3686

swheaton opened this issue Oct 18, 2023 · 1 comment · Fixed by #3690
Labels
bug Bug fixes

Comments

@swheaton
Copy link
Contributor

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Mac OSX
  • Python version (python --version): 3.8.10
  • FiftyOne version (fiftyone --version): 0.22.1
  • FiftyOne installed from (pip or source): pip

Describe the problem

I get an error ValueError: Layer 'head' is an Identity layer. Use previous layer. when downloading DINOv2 zoo models.. Below is one, I tried most of the others and got the same error.

>>> m=fo.zoo.load_zoo_model('dinov2-vits14-torch')
Downloading: "https://dl.fbaipublicfiles.com/dinov2/dinov2_vits14/dinov2_vits14_pretrain.pth" to /Users/stuart/.cache/torch/hub/checkpoints/dinov2_vits14_pretrain.pth
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 84.2M/84.2M [00:01<00:00, 49.3MB/s]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/stuart/dev/fiftyone_venv2/lib/python3.8/site-packages/fiftyone/zoo/models/__init__.py", line 253, in load_zoo_model
    model = fom.load_model(config_dict, model_path=model_path, **kwargs)
  File "/Users/stuart/dev/fiftyone_venv2/lib/python3.8/site-packages/fiftyone/core/models.py", line 1777, in load_model
    return config.build()
  File "/Users/stuart/dev/fiftyone_venv2/lib/python3.8/site-packages/eta/core/learning.py", line 296, in build
    return self._model_cls(self.config)
  File "/Users/stuart/dev/fiftyone_venv2/lib/python3.8/site-packages/fiftyone/utils/torch.py", line 549, in __init__
    TorchEmbeddingsMixin.__init__(
  File "/Users/stuart/dev/fiftyone_venv2/lib/python3.8/site-packages/fiftyone/utils/torch.py", line 271, in __init__
    embeddings_layer = SaveLayerTensor(model, layer_name)
  File "/Users/stuart/dev/fiftyone_venv2/lib/python3.8/site-packages/fiftyone/utils/torch.py", line 1010, in __init__
    self._setup(model, layer_name)
  File "/Users/stuart/dev/fiftyone_venv2/lib/python3.8/site-packages/fiftyone/utils/torch.py", line 1035, in _setup
    raise ValueError(
ValueError: Layer 'head' is an Identity layer. Use previous layer.

Code to reproduce issue

import fiftyone as fo
model=fo.zoo.load_zoo_model('dinov2-vits14-torch')

What areas of FiftyOne does this bug affect?

  • App: FiftyOne application issue
  • Core: Core Python library issue
  • Server: FiftyOne server issue
  • Zoo: FiftyOne Zoo

Willingness to contribute

The FiftyOne Community encourages bug fix contributions. Would you or another member of your organization be willing to contribute a fix for this bug to the FiftyOne codebase?

  • Yes. I can contribute a fix for this bug independently
  • Yes. I would be willing to contribute a fix for this bug with guidance from the FiftyOne community
  • No. I cannot contribute a bug fix at this time
@swheaton swheaton added the bug Bug fixes label Oct 18, 2023
@brimoor brimoor mentioned this issue Oct 19, 2023
brimoor added a commit that referenced this issue Oct 19, 2023
@brimoor
Copy link
Contributor

brimoor commented Nov 17, 2023

This was resolved by #3690 which was released in fiftyone==0.22.2. Unsure why GH did not automatically close this.

@brimoor brimoor closed this as completed Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants