kijai / ComfyUI-Florence2

Inference Microsoft Florence2 VLM
MIT License
773 stars 53 forks source link

Failed to load the model. #84

Open yiyabo opened 1 month ago

yiyabo commented 1 month ago

Here is my error report.Here is my error report. I would like to ask why this is the case? The files in my /root/models/LLM/CogFlorence-2.2-Large are complete. Then what is microsoft/Florence-2-large? Is it in the hug in.cache?:

Loading model from /root/models/LLM/CogFlorence-2.2-Large using sdpa for attention Could not locate the processing_florence2.py inside microsoft/Florence-2-large. !!! Exception during processing !!! We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like microsoft/Florence-2-large is not the path to a directory containing a file named processing_florence2.py. Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'. Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 198, in _new_conn sock = connection.create_connection( File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection raise err File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 73, in create_connection sock.connect(sa) TimeoutError: timed out

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

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 793, in urlopen response = self._make_request( File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 491, in _make_request raise new_e File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 467, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1099, in _validate_conn conn.connect() File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 616, in connect self.sock = sock = self._new_conn() File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 207, in _new_conn raise ConnectTimeoutError( urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x7f85862f3ca0>, 'Connection to huggingface.co timed out. (connect timeout=10)')

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

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 667, in send resp = conn.urlopen( File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 847, in urlopen retries = retries.increment( File "/usr/local/lib/python3.10/site-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: /microsoft/Florence-2-large/resolve/main/processing_florence2.py (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f85862f3ca0>, 'Connection to huggingface.co timed out. (connect timeout=10)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1722, in _get_metadata_or_catch_error metadata = get_hf_file_metadata(url=url, proxies=proxies, timeout=etag_timeout, headers=headers) File "/usr/local/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(args, kwargs) File "/usr/local/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1645, in get_hf_file_metadata r = _request_wrapper( File "/usr/local/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 372, in _request_wrapper response = _request_wrapper( File "/usr/local/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 395, in _request_wrapper response = get_session().request(method=method, url=url, params) File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, kwargs) File "/usr/local/lib/python3.10/site-packages/huggingface_hub/utils/_http.py", line 66, in send return super().send(request, args, **kwargs) File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 688, in send raise ConnectTimeout(e, request=request) requests.exceptions.ConnectTimeout: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /microsoft/Florence-2-large/resolve/main/processing_florence2.py (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f85862f3ca0>, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: 0ff49cd8-8c54-4868-832d-28ab3f202036)')

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

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/transformers/utils/hub.py", line 398, in cached_file resolved_file = hf_hub_download( File "/usr/local/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1221, in hf_hub_download return _hf_hub_download_to_cache_dir( File "/usr/local/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1325, in _hf_hub_download_to_cache_dir _raise_on_head_call_error(head_call_error, force_download, local_files_only) File "/usr/local/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1826, in _raise_on_head_call_error 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.

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

Traceback (most recent call last): File "/root/ComfyUI/execution.py", line 323, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "/root/ComfyUI/execution.py", line 198, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "/root/ComfyUI/execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "/root/ComfyUI/execution.py", line 158, in process_inputs results.append(getattr(obj, func)(**inputs)) File "/root/ComfyUI/custom_nodes/ComfyUI-Florence2/nodes.py", line 174, in loadmodel processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True) File "/usr/local/lib/python3.10/site-packages/transformers/models/auto/processing_auto.py", line 303, in from_pretrained processor_class = get_class_from_dynamic_module( File "/usr/local/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 489, in get_class_from_dynamic_module final_module = get_cached_module_file( File "/usr/local/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 294, in get_cached_module_file resolved_module_file = cached_file( File "/usr/local/lib/python3.10/site-packages/transformers/utils/hub.py", line 441, in cached_file raise EnvironmentError( OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like microsoft/Florence-2-large is not the path to a directory containing a file named processing_florence2.py. Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.

yiyabo commented 1 month ago

By the way, I can't connect the huggingface. So I can't expect it to download automatically.

yiyabo commented 1 month ago

I solve the problems. The models have four locations. The first one is located in models/LLM/. The second one is located in /root/.cache/huggingface/hub/models--microsoft--Florence-2-large. The third one is located in /root/.cache/huggingface/modules/transformers_modules/CogFlorence-2.2-Large. The fourth one is located in /root/.cache/huggingface/modules/transformers_modules/microsoft.