Open mrwangxinqwe opened 2 months ago
I replaced 'model = UniDepthV1.from_pretrained("lpiccinelli/unidepth-v1-vitl14")' with 'model = torch.hub.load( "lpiccinelli-eth/unidepth", "UniDepthV1_ConvNextL", # MAP_BACKBONES = {"ViTL14": "vitl14", "ConvNextL": "cnvnxtl"} pretrained=True, trust_repo=True, force_reload=True, )' in demo.py , demo.py has the desired effect.
Whichhuggingface_hub
version are you using?
@lpiccinelli-eth huggingface-hub 0.22.2
I lowered the version to 0.22.0, but still got the same error.
I also have this problem, can you tell me how to solve it?
It looks like from_pretrained
method of ModelHubMixin
class fails at downloading the configs from Huggingface repo, so the method cannot populate the model arguments like the config.
You can try setting the parameter force_download
in UniDepthV2.from_pretrained(..., force_download=True)
, the plan B would be using Torch Hub.
My version was cloned on April 26 and has the same problems that people have asked about before.That's the question that comes up: Torch version: 2.2.0+cu118 Traceback (most recent call last): File "/home/wx/Downloads/UniDepth-main/scripts/demo.py", line 40, in
model = UniDepthV1.from_pretrained("lpiccinelli/unidepth-v1-vitl14")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/wx/anaconda3/envs/unidepth/lib/python3.11/site-packages/huggingface_hub/utils/_validators.py", line 119, in _inner_fn
return fn(*args, kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/wx/anaconda3/envs/unidepth/lib/python3.11/site-packages/huggingface_hub/hub_mixin.py", line 420, in from_pretrained
instance = cls._from_pretrained(
^^^^^^^^^^^^^^^^^^^^^
File "/home/wx/anaconda3/envs/unidepth/lib/python3.11/site-packages/huggingface_hub/hub_mixin.py", line 643, in _from_pretrained
model = cls(model_kwargs)
^^^^^^^^^^^^^^^^^^^
TypeError: UniDepthV1.init() missing 1 required positional argument: 'config'