nomewang / M3DM

MIT License
129 stars 16 forks source link

huggingface_hub.utils._errors.LocalEntryNotFoundError: An error happened while trying to locate the file #22

Closed asadmujtaba closed 8 months ago

asadmujtaba commented 8 months ago

I am getting the following error while running the main.py. Can you guide what's wrong? The internet is working fine. huggingface_hub.utils._errors.LocalEntryNotFoundError: An error happened while trying to locate the file on the Hub

/usr/local/lib/python3.8/dist-packages/timm/models/_factory.py:114: UserWarning: Mapping deprecated model name vit_base_patch8_224_dino to current vit_base_patch8_224.dino. model = create_fn( Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/urllib3/connection.py", line 203, in _new_conn sock = connection.create_connection( File "/usr/local/lib/python3.8/dist-packages/urllib3/util/connection.py", line 60, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 791, in urlopen response = self._make_request( File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 492, in _make_request raise new_e File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 468, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 1097, in _validate_conn conn.connect() File "/usr/local/lib/python3.8/dist-packages/urllib3/connection.py", line 611, in connect self.sock = sock = self._new_conn() File "/usr/local/lib/python3.8/dist-packages/urllib3/connection.py", line 210, in _new_conn raise NameResolutionError(self.host, self, e) from e urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPSConnection object at 0x7fe5c510d8b0>: Failed to resolve 'huggingface.co' ([Errno -2] Name or service not known)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 845, in urlopen retries = retries.increment( File "/usr/local/lib/python3.8/dist-packages/urllib3/util/retry.py", line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /timm/vit_base_patch8_224.dino/resolve/main/pytorch_model.bin (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7fe5c510d8b0>: Failed to resolve 'huggingface.co' ([Errno -2] Name or service not known)"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/file_download.py", line 1233, in hf_hub_download metadata = get_hf_file_metadata( File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(args, kwargs) File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/file_download.py", line 1613, in get_hf_file_metadata r = _request_wrapper( File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/file_download.py", line 418, in _request_wrapper response = _request_wrapper( File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/file_download.py", line 453, in _request_wrapper return http_backoff( File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, kwargs) File "/usr/local/lib/python3.8/dist-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python3.8/dist-packages/requests/sessions.py", line 703, in send r = adapter.send(request, kwargs) File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/requests/adapters.py", line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: (MaxRetryError('HTTPSConnectionPool(host=\'huggingface.co\', port=443): Max retries exceeded with url: /timm/vit_base_patch8_224.dino/resolve/main/pytorch_model.bin (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7fe5c510d8b0>: Failed to resolve \'huggingface.co\' ([Errno -2] Name or service not known)"))'), '(Request ID: f01dfa6f-9e08-407c-88b7-6bd2f215d6d9)')

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "main.py", line 124, in run_3d_ads(args) File "main.py", line 19, in run_3d_ads model = M3DM(args) File "/codes/m3dm_runner.py", line 28, in init "DINO+Point_MAE": multiple_features.DoubleRGBPointFeatures(args), File "/codes/feature_extractors/features.py", line 33, in init self.deep_feature_extractor = Model( File "/codes/models/models.py", line 22, in init self.rgb_backbone = timm.create_model(model_name=rgb_backbone_name, pretrained=True, checkpoint_path=checkpoint_path, File "/usr/local/lib/python3.8/dist-packages/timm/models/_factory.py", line 114, in create_model model = create_fn( File "/usr/local/lib/python3.8/dist-packages/timm/models/_registry.py", line 139, in _fn return current_fn(pretrained=pretrained, pretrained_cfg=pretrained_cfg or current_tag, kwargs) File "/usr/local/lib/python3.8/dist-packages/timm/models/vision_transformer.py", line 1730, in vit_base_patch8_224 model = _create_vision_transformer('vit_base_patch8_224', pretrained=pretrained, dict(model_args, *kwargs)) File "/usr/local/lib/python3.8/dist-packages/timm/models/vision_transformer.py", line 1611, in _create_vision_transformer return build_model_with_cfg( File "/usr/local/lib/python3.8/dist-packages/timm/models/_builder.py", line 397, in build_model_with_cfg load_pretrained( File "/usr/local/lib/python3.8/dist-packages/timm/models/_builder.py", line 190, in load_pretrained state_dict = load_state_dict_from_hf(pretrained_loc) File "/usr/local/lib/python3.8/dist-packages/timm/models/_hub.py", line 188, in load_state_dict_from_hf cached_file = hf_hub_download(hf_model_id, filename=filename, revision=hf_revision) File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/file_download.py", line 1363, in hf_hub_download raise LocalEntryNotFoundError( huggingface_hub.utils._errors.LocalEntryNotFoundError: An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on.

iakRulan commented 8 months ago

挂VPN可以解决,

asadmujtaba commented 8 months ago

Thanks.. Resolved with VPN