8000 Error running inference - loading DepthAnything · Issue #8 · MegaScenes/nvs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Error running inference - loading DepthAnything #8
Open
@morrisalp

Description

@morrisalp

Running inference (python video_script.py) with the provided snippet yields this error:

Traceback (most recent call last):                                                                                                                                                                          
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 409, in hf_raise_for_status                                                               
    response.raise_for_status()                                                                                                                                                                             
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/requests/models.py", line 1024, in raise_for_status                                                                             
    raise HTTPError(http_error_msg, response=self)                                                                                                                                                          
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/LiheYoung/depth_anything_vitl14/resolve/main/model.safetensors                                                   
                                                                                                                                                                                                            
The above exception was the direct cause of the following exception:                                                                                                                                        
                                                                                                                                                                                                            
Traceback (most recent call last):                                                                                                                                                                          
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/huggingface_hub/hub_mixin.py", line 796, in _from_pretrained                                                                    
    model_file = hf_hub_download(                                                                                                                                                                           
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn                                                                   
    return fn(*args, **kwargs)                                                                                                                                                                              
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 961, in hf_hub_download                                                                 
    return _hf_hub_download_to_cache_dir(                                                                                                                                                                   
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 1024, in _hf_hub_download_to_cache_dir                                                  
    (url_to_download, etag, commit_hash, expected_size, xet_file_data, head_call_error) = _get_metadata_or_catch_error(                                                                                     
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 1484, in _get_metadata_or_catch_error                                                   
    metadata = get_hf_file_metadata(                                                                                                                                                                        
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn                                                                   
    return fn(*args, **kwargs)                                                                                                                                                                              
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 1401, in get_hf_file_metadata                                                           
    r = _request_wrapper(                                                                                                                                                                                   
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 285, in _request_wrapper                                                                
    response = _request_wrapper(                                                                                                                                                                            
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 309, in _request_wrapper                                                                
    hf_raise_for_status(response)                                                                                                                                                                           
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 420, in hf_raise_for_status                                                               
    raise _format(EntryNotFoundError, message, response) from e                                                                                                                                             
huggingface_hub.errors.EntryNotFoundError: 404 Client Error. (Request ID: Root=1-67f69c2a-7158d6ea26ec32890b3c47a9;83df6896-d694-41cf-9103-d0893e7cfff3)                                                    
                                                                                                                                                                                                            
Entry Not Found for url: https://huggingface.co/LiheYoung/depth_anything_vitl14/resolve/main/model.safetensors.   

During handling of the above exception, another exception occurred:                                                                                                                                         
                                                                                                                                                                                                            
Traceback (most recent call last):                                                                                                                                                                          
  File "video_script.py", line 348, in <module>                                                                                                                                                             
    main()                                                                                                                                                                                                  
  File "video_script.py", line 209, in main                                                                                                                                                                 
    refimg, refimg_nopad, orbitwarps, orbit_rel_poses, spiralwarps, spiral_rel_poses = setup_scene_and_poses()                                                                                              
  File "video_script.py", line 82, in setup_scene_and_poses                                                                                                                                                 
    depth_model, dtransform = load_depth_model()                                                                                                                                                            
  File "/scratch/morris/repos/nvs/dataloader/evalhelpers.py", line 123, in load_depth_model                                                                                                                 
    depth_model = DepthAnything.from_pretrained('LiheYoung/depth_anything_{:}14'.format(encoder)).cuda().eval()                                                                                             
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn                                                                   
    return fn(*args, **kwargs)                                                                                                                                                                              
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/huggingface_hub/hub_mixin.py", line 566, in from_pretrained                                                                     
    instance = cls._from_pretrained(                                                                                                                                                                        
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/huggingface_hub/hub_mixin.py", line 820, in _from_pretrained                                                                    
    return cls._load_as_pickle(model, model_file, map_location, strict)                                                                                                                                     
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/huggingface_hub/hub_mixin.py", line 824, in _load_as_pickle                                                                     
    state_dict = torch.load(model_file, map_location=torch.device(map_location), weights_only=True)                                                                                                         
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/torch/serialization.py", line 712, in load                                                                                      
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)                                                                                                                           
  File "/home/morris/miniconda3/envs/megascenes/lib/python3.8/site-packages/torch/serialization.py", line 1047, in _load                                                                                    
    unpickler = UnpicklerWrapper(data_file, **pickle_load_args)                                                                                                                                             
TypeError: 'weights_only' is an invalid keyword argument for Unpickler()                                                                                                                                                                                                                              

I think it's expecting the safetensors version of the DA model but this PR was not merged: https://huggingface.co/LiheYoung/depth_anything_vitl14/discussions/3

Then the fallback loading fails due to the torch version in requirements.txt being 1.12.1 as per: UKPLab/sentence-transformers#2455

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0