IDEA-Research / Grounded-Segment-Anything

Grounded SAM: Marrying Grounding DINO with Segment Anything & Stable Diffusion & Recognize Anything - Automatically Detect , Segment and Generate Anything
https://arxiv.org/abs/2401.14159
Apache License 2.0
14.23k stars 1.31k forks source link

无法运行,无法运行!!!!! #442

Open tsqt2023 opened 5 months ago

tsqt2023 commented 5 months ago

我把所有的权重部署到了本地但是,不管怎么改都无法绕过下载模型这个操作。 /home/mouxing/anaconda3/envs/Grounded-Segment-Anything/bin/python /home/mouxing/PYTHON/Kop/Grounded-Segment-Anything/grounding_dino_demo.py HF_DATASETS_OFFLINE=1 TRANSFORMERS_OFFLINE=1 \ /home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3526.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] final text_encoder_type: bert-base-uncased Traceback (most recent call last): File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/urllib3/util/connection.py", line 95, in create_connection raise err File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/urllib3/util/connection.py", line 85, in create_connection sock.connect(sa) OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/urllib3/connectionpool.py", line 404, in _make_request self._validate_conn(conn) File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1058, in _validate_conn conn.connect() File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/urllib3/connection.py", line 363, in connect self.sock = conn = self._new_conn() File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f55b789b520>: Failed to establish a new connection: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/requests/adapters.py", line 489, in send resp = conn.urlopen( File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /bert-base-uncased/resolve/main/config.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f55b789b520>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/huggingface_hub/file_download.py", line 1238, in hf_hub_download metadata = get_hf_file_metadata( File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(args, kwargs) File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/huggingface_hub/file_download.py", line 1631, in get_hf_file_metadata r = _request_wrapper( File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/huggingface_hub/file_download.py", line 385, in _request_wrapper response = _request_wrapper( File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/huggingface_hub/file_download.py", line 408, in _request_wrapper response = get_session().request(method=method, url=url, params) File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/requests/sessions.py", line 587, in request resp = self.send(prep, send_kwargs) File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/requests/sessions.py", line 701, in send r = adapter.send(request, kwargs) File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/huggingface_hub/utils/_http.py", line 67, in send return super().send(request, args, **kwargs) File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/requests/adapters.py", line 565, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /bert-base-uncased/resolve/main/config.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f55b789b520>: Failed to establish a new connection: [Errno 101] Network is unreachable'))"), '(Request ID: c718b6bf-14f0-4e05-86e6-70c9616646f6)')

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

Traceback (most recent call last): File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/transformers/utils/hub.py", line 409, in cached_file resolved_file = hf_hub_download( File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/huggingface_hub/file_download.py", line 1371, 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.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/mouxing/PYTHON/Kop/Grounded-Segment-Anything/grounding_dino_demo.py", line 14, in model = load_model(CONFIG_PATH, CHECKPOINT_PATH) File "/home/mouxing/PYTHON/Kop/Grounded-Segment-Anything/GroundingDINO/groundingdino/util/inference.py", line 32, in load_model model = build_model(args) File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/groundingdino-0.1.0-py3.9-linux-x86_64.egg/groundingdino/models/init.py", line 17, in build_model model = build_func(args) File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/groundingdino-0.1.0-py3.9-linux-x86_64.egg/groundingdino/models/GroundingDINO/groundingdino.py", line 372, in build_groundingdino model = GroundingDINO( File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/groundingdino-0.1.0-py3.9-linux-x86_64.egg/groundingdino/models/GroundingDINO/groundingdino.py", line 107, in init self.tokenizer = get_tokenlizer.get_tokenlizer(text_encoder_type) File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/groundingdino-0.1.0-py3.9-linux-x86_64.egg/groundingdino/util/get_tokenlizer.py", line 17, in get_tokenlizer tokenizer = AutoTokenizer.from_pretrained(text_encoder_type) File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/transformers/models/auto/tokenization_auto.py", line 597, in from_pretrained config = AutoConfig.from_pretrained( File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/transformers/models/auto/configuration_auto.py", line 809, in from_pretrained config_dict, unused_kwargs = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, kwargs) File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/transformers/configuration_utils.py", line 559, in get_config_dict config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, kwargs) File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/transformers/configuration_utils.py", line 614, in _get_config_dict resolved_config_file = cached_file( File "/home/mouxing/anaconda3/envs/Grounded-Segment-Anything/lib/python3.9/site-packages/transformers/utils/hub.py", line 443, 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 bert-base-uncased is not the path to a directory containing a file named config.json. Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.

进程已结束,退出代码为 1

rentainhe commented 5 months ago

这里的问题似乎是网络问题,无法访问Huggingface去下载对应的文件

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 bert-base-uncased is not the path to a directory containing a file named config.json. Checkout your internet connection or see how to run the library in offline mode at

kidcad1412 commented 3 months ago

请问一下解决了吗?我也是下到本地,添加了os.environ['HF_HOME'] = "我的权重路径",但是还是报找不到

HZWHH commented 2 months ago

请问怎么解决的?