-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
connection issue #8690
Comments
Having a similar issue while running Multi class classification model |
Hi getting this erorr Exception in device=TPU:0: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on. |
this is with transformer 3.5.1, pytorch 1.6, on TPU v3-8, and I am using xla_spawn to launch the jobs, looks like a general issue with caching part. |
Same for me. Getting this error while trying to execute following line: File "/Users/xxx/anaconda3/envs/test/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 1629, in from_pretrained |
to me this is not a connection issue. i do have connection but an issue in
caching mechanism.
…On Wed, Nov 25, 2020, 2:33 AM Alkesh ***@***.***> wrote:
Same for me. Getting this error while trying to execute following line:
tokenizer = LxmertTokenizer.from_pretrained('unc-nlp/lxmert-base-uncased')
File
"/Users/xxx/anaconda3/envs/test/lib/python3.7/site-packages/transformers/tokenization_utils_base.py",
line 1629, in from_pretrained
local_files_only=local_files_only,
File
"/Users/xxx/anaconda3/envs/test/lib/python3.7/site-packages/transformers/file_utils.py",
line 955, in cached_path
local_files_only=local_files_only,
File
"/Users/xxx/anaconda3/envs/test/lib/python3.7/site-packages/transformers/file_utils.py",
line 1125, in get_from_cache
"Connection error, and we cannot find the requested files in the cached
path."
ValueError: Connection error, and we cannot find the requested files in
the cached path. Please try again or make sure your Internet connection is
on.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8690 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABP4ZCGOHVMHGA33EGSQ6UTSRRNGTANCNFSM4T5CBSUA>
.
|
I am having the same issue too. I am pointing to the cache directory where pytorch is saving the models: modelpath = "bert-base-uncased" model = AutoModel.from_pretrained(modelpath, cache_dir=cache_dir) tokenizer = AutoTokenizer.from_pretrained(modelpath, cache_dir=cache_dir) |
Working on a fix, hopefully fixed for good today. Meanwhile as a workaround please retry a couple minutes later should do the trick |
I deleted all cache, redownloaded all modes and ran again. It seems to be working as of now. |
Scaling of connectivity for model hosting should be way improved now. Please comment here if you still experience connectivity issues from now on. Thanks! |
I am still getting this error with transformers version - 3.5.1 and torch - 1.7.0 on python 3.6.9. Please check. I have tried deleting all cache, installing transformers using pip and source code both. But still getting the same issue again and again. |
@AshishDuhan Are you loading a model in particular? Do you have a code snippet that consistently fails for you? |
_import torch src_text = [""""""] This is one of the models I am trying to load. Although I have tried other models too and nothing works. Even the basic command fail with following error: python -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('we love you'))" |
Our connectivity has been good these past 24 hours so this might be a different (local) issue, @AshishDuhan. Are you behind a proxy by any chance? Does |
I am facing the same issue still - Traceback (most recent call last): |
I'm having the same connection issue. I've tried with and without passing my proxies into the BertModel ValueError Traceback (most recent call last) ~/opt/anaconda3/envs/milglue/lib/python3.8/site-packages/transformers/modeling_utils.py in from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs) ~/opt/anaconda3/envs/milglue/lib/python3.8/site-packages/transformers/configuration_utils.py in from_pretrained(cls, pretrained_model_name_or_path, **kwargs) ~/opt/anaconda3/envs/milglue/lib/python3.8/site-packages/transformers/configuration_utils.py in get_config_dict(cls, pretrained_model_name_or_path, **kwargs) ~/opt/anaconda3/envs/milglue/lib/python3.8/site-packages/transformers/file_utils.py in cached_path(url_or_filename, cache_dir, force_download, proxies, resume_download, user_agent, extract_compressed_file, force_extract, local_files_only) ~/opt/anaconda3/envs/milglue/lib/python3.8/site-packages/transformers/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only) ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on. |
Hard to say without seeing your full networking environment. If you try to |
it happened to me too , is there any fix on that ? |
is it transient or permanent (i.e. if you relaunch the command does it happen again)? You need to give us some more details if we want to help you troubleshoot. |
Hi
|
Looks like you are getting a timeout connecting to |
Hi, from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("bert-base-cased") model = AutoModelForMaskedLM.from_pretrained("bert-base-cased") ValueError Traceback (most recent call last) ~\Anaconda3\envs\bert-test\lib\site-packages\transformers\models\auto\tokenization_auto.py in from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs) ~\Anaconda3\envs\bert-test\lib\site-packages\transformers\models\auto\configuration_auto.py in from_pretrained(cls, pretrained_model_name_or_path, **kwargs) ~\Anaconda3\envs\bert-test\lib\site-packages\transformers\configuration_utils.py in get_config_dict(cls, pretrained_model_name_or_path, **kwargs) ~\Anaconda3\envs\bert-test\lib\site-packages\transformers\file_utils.py in cached_path(url_or_filename, cache_dir, force_download, proxies, resume_download, user_agent, extract_compressed_file, force_extract, local_files_only) ~\Anaconda3\envs\bert-test\lib\site-packages\transformers\file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only) ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on. |
Can you try the debugging procedure mentioned in #8690 (comment)? |
i am able to open 8690 in web browser. but the error still remains: qa = text.SimpleQA(INDEXDIR) ValueError Traceback (most recent call last) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\transformers\modeling_tf_auto.py in from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\transformers\configuration_auto.py in from_pretrained(cls, pretrained_model_name_or_path, **kwargs) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\transformers\configuration_utils.py in get_config_dict(cls, pretrained_model_name_or_path, **kwargs) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\transformers\file_utils.py in cached_path(url_or_filename, cache_dir, force_download, proxies, resume_download, user_agent, extract_compressed_file, force_extract, local_files_only) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\transformers\file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only) ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on. During handling of the above exception, another exception occurred: ValueError Traceback (most recent call last) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\ktrain\text\qa\core.py in init(self, index_dir, bert_squad_model, bert_emb_model) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\ktrain\text\qa\core.py in init(self, bert_squad_model, bert_emb_model) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\transformers\modeling_tf_auto.py in from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\transformers\configuration_auto.py in from_pretrained(cls, pretrained_model_name_or_path, **kwargs) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\transformers\configuration_utils.py in get_config_dict(cls, pretrained_model_name_or_path, **kwargs) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\transformers\file_utils.py in cached_path(url_or_filename, cache_dir, force_download, proxies, resume_download, user_agent, extract_compressed_file, force_extract, local_files_only) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\transformers\file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only) ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on. |
still get this error for transformer 4.1.1 with torch 1.7.1 error message here:
|
try transformers 4.00 transformers:4.1 #8690 (comment)
|
I also ran into this error while trying to download any huggingface model. Turns out for me the cause was that I had set an |
It appears to be an SSL/TLS certificate error as @robinderat alludes to, but there are several possible reasons. Here's how I've debugged this, hopefully it helps others although your root cause may be different. DebuggingOriginal error, fetching model from
Check with
Checking with
Disabling curl's certificate validation with
And now in Python, using
ResolutionSo the "problem" is in the certificate. Checking in a browser, the root certificate of Checking my server clock shows that it was out of date (27 January 20201) and critically, before the certificate is valid from, which makes sense that the root error was "certificate verify failed: certificate is not yet valid". Set the clock to the real time and check again:
I now suspect that this host in GCP, which was suspended for a while, did not automatically update it's local time causing this specific problem. Conclusion@julien-c I would only suggest at this point that making the root cause visible in the error coming out of 🎉 |
@joshdevins nice troubleshooting! The issue here is that on this line transformers/src/transformers/file_utils.py Line 1231 in 6710d1d
we catch requests ' ConnectionError (if I'm not mistaken, triggered when you're offline) but SSLError (and ProxyError for that matter), which we wouldn't want to catch, inherit from ConnectionError.
See We could at least probably rethrow the exceptions in those cases. |
see tentative fix over at huggingface/huggingface_hub@34b7b70 @joshdevins let me know if this looks good |
@julien-c Looks good. I was able to recreate the original problem and applying your patch makes the root cause error much more visible. Thanks! 👍 |
just restart the system and then reconnect the internet ....will solve the issue..happy day |
Super bro... thanks a lot.. its working |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
Hi, Can anyone please tell me how you were able to resolve this issue? I am facing the connection error as below. ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on. |
i face the save error;
|
why don't you restart the system. |
Hi,
When importing:
I guess this error is triggered because of my location (I am in Iran). I also tried with and without a VPN and neither worked. Can there be any hope for me to download a transformer model? |
FYI I was getting this error when training on multiple gpus with multi-processing maybe due to too many requests at the same time. I could flakily reproduce with:
The solution for me was to force offline mode:
|
How do you delete cache of GPT-2 model? |
you can pass |
got this error |
I have encountered this error more than once. The solution can be various, e.g., sometimes I delete all my cached files, and sometimes I just delete some big files (model files), and also sometimes I just wait for it for several minutes then it works again without doing anything... I am really confused by this error. Personally, I think this error can be caused by many reasons. Hope a more detailed and specific error log could be provided in the future. |
My issue was because there were no internet connection by default. So I had to solve the internet problem and it worked for me. |
Hi
I am runnig seq2seq_trainer on TPUs I am always getting this connection issue could you please have a look
sicne this is on TPUs this is hard for me to debug
thanks
Best
Rabeeh
File "/anaconda3/envs/torch-xla-1.7/lib/python3.6/site-packages/transformers/file_utils.py", line 955, in cached_path
local_files_only=local_files_only,
File "/anaconda3/envs/torch-xla-1.7/lib/python3.6/site-packages/transformers/file_utils.py", line 1125, in get_from_cache
"Connection error, and we cannot find the requested files in the cached path."
ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on.
Traceback (most recent call last):
File "/home/rabeeh//internship/seq2seq/xla_spawn.py", line 71, in
main()
XLA label: %copy.32724.remat = f32[80,12,128,128]{3,2,1,0:T(8,128)} copy(f32[80,12,128,128]{2,3,1,0:T(8,128)} %bitcast.576)
Allocation type: HLO temp
==========================
Shape: f32[80,12,128,128]{3,2,1,0:T(8,128)}
Unpadded size: 60.00M
XLA label: %copy.32711.remat = f32[80,12,128,128]{3,2,1,0:T(8,128)} copy(f32[80,12,128,128]{2,3,1,0:T(8,128)
0%| | 2/18060 [08:12<1234:22:09, 246.08s/it]Traceback (most recent call last):
File "/home/rabeeh//internship/seq2seq/xla_spawn.py", line 71, in
main()
File "/home/rabeeh//internship/seq2seq/xla_spawn.py", line 67, in main
xmp.spawn(mod._mp_fn, args=(), nprocs=args.num_cores)
File "/anaconda3/envs/torch-xla-1.7/lib/python3.6/site-packages/torch_xla/distributed/xla_multiprocessing.py", line 395, in spawn
start_method=start_method)
File "/anaconda3/envs/torch-xla-1.7/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 157, in start_processes
while not context.join():
File "/anaconda3/envs/torch-xla-1.7/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 112, in join
(error_index, exitcode)
The text was updated successfully, but these errors were encountered: