Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行训练完的模型会报错 #88

Open
sssssshf opened this issue Sep 10, 2024 · 0 comments
Open

运行训练完的模型会报错 #88

sssssshf opened this issue Sep 10, 2024 · 0 comments

Comments

@sssssshf
Copy link

运行如下代码

python "/media/shf/sda/code/Multimodal/Open-GroundingDino-main/tools/inference_on_a_image.py"
-c "/media/shf/sda/code/Multimodal/Open-GroundingDino-main/tools/GroundingDINO_SwinT_OGC.py"
-p "/media/shf/sda/code/Multimodal/Open-GroundingDino-main/content/output/eval/latest.pth"
-i "/media/shf/sda/code/Multimodal/Open-GroundingDino-main/content/aquarium_data/valid/IMG_2277_jpeg_jpg.rf.86c72d6192da48d941ffa957f4780665.jpg"
-t "fish . jellyfish . penguins . sharks . puffins . stingrays . starfish "
-o pred_images

/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/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:3483.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
final text_encoder_type: bert-base-uncased
Traceback (most recent call last):
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/urllib3/connection.py", line 196, in _new_conn
sock = connection.create_connection(
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/urllib3/util/connection.py", line 85, in create_connection
raise err
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/urllib3/util/connection.py", line 73, in create_connection
sock.connect(sa)
OSError: [Errno 101] Network is unreachable

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

Traceback (most recent call last):
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/urllib3/connectionpool.py", line 789, in urlopen
response = self._make_request(
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/urllib3/connectionpool.py", line 490, in _make_request
raise new_e
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/urllib3/connectionpool.py", line 466, in _make_request
self._validate_conn(conn)
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1095, in _validate_conn
conn.connect()
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/urllib3/connection.py", line 615, in connect
self.sock = sock = self._new_conn()
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/urllib3/connection.py", line 211, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f4cc0813e50>: Failed to establish a new connection: [Errno 101] Network is unreachable

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

Traceback (most recent call last):
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/requests/adapters.py", line 667, in send
resp = conn.urlopen(
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/urllib3/connectionpool.py", line 843, in urlopen
retries = retries.increment(
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/urllib3/util/retry.py", line 519, 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: /bert-base-uncased/resolve/main/config.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f4cc0813e50>: 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/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 1751, in _get_metadata_or_catch_error
metadata = get_hf_file_metadata(
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 1673, in get_hf_file_metadata
r = _request_wrapper(
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 376, in _request_wrapper
response = _request_wrapper(
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 399, in _request_wrapper
response = get_session().request(method=method, url=url, **params)
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 66, in send
return super().send(request, *args, **kwargs)
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/requests/adapters.py", line 700, 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 0x7f4cc0813e50>: Failed to establish a new connection: [Errno 101] Network is unreachable'))"), '(Request ID: a1f298fa-fb5c-49e0-89a2-321dc1515e68)')

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

Traceback (most recent call last):
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/transformers/utils/hub.py", line 402, in cached_file
resolved_file = hf_hub_download(
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/huggingface_hub/utils/_deprecation.py", line 101, in inner_f
return f(*args, **kwargs)
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 1240, in hf_hub_download
return _hf_hub_download_to_cache_dir(
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 1347, in _hf_hub_download_to_cache_dir
_raise_on_head_call_error(head_call_error, force_download, local_files_only)
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 1857, 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 "/media/shf/sda/code/Multimodal/Open-GroundingDino-main/tools/inference_on_a_image.py", line 188, in
model = load_model(config_file, checkpoint_path, cpu_only=args.cpu_only)
File "/media/shf/sda/code/Multimodal/Open-GroundingDino-main/tools/inference_on_a_image.py", line 75, in load_model
model = build_model(args)
File "/media/shf/sda/code/Multimodal/GroundingDINO/groundingdino/models/init.py", line 17, in build_model
model = build_func(args)
File "/media/shf/sda/code/Multimodal/GroundingDINO/groundingdino/models/GroundingDINO/groundingdino.py", line 388, in build_groundingdino
model = GroundingDINO(
File "/media/shf/sda/code/Multimodal/GroundingDINO/groundingdino/models/GroundingDINO/groundingdino.py", line 107, in init
self.tokenizer = get_tokenlizer.get_tokenlizer(text_encoder_type)
File "/media/shf/sda/code/Multimodal/GroundingDINO/groundingdino/util/get_tokenlizer.py", line 19, in get_tokenlizer
tokenizer = AutoTokenizer.from_pretrained(text_encoder_type)
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/transformers/models/auto/tokenization_auto.py", line 854, in from_pretrained
config = AutoConfig.from_pretrained(
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/transformers/models/auto/configuration_auto.py", line 976, in from_pretrained
config_dict, unused_kwargs = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs)
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/transformers/configuration_utils.py", line 632, in get_config_dict
config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs)
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/transformers/configuration_utils.py", line 689, in _get_config_dict
resolved_config_file = cached_file(
File "/home/shf/miniforge-pypy3/envs/shf/lib/python3.8/site-packages/transformers/utils/hub.py", line 445, 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'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant