ThilinaRajapakse / pytorch-transformers-classification

Based on the Pytorch-Transformers library by HuggingFace. To be used as a starting point for employing Transformer models in text classification tasks. Contains code to easily train BERT, XLNet, RoBERTa, and XLM models for text classification.
Apache License 2.0
306 stars 97 forks source link

OpenSSL.SSL.Error when pulling xlm model #2

Closed mingchen62 closed 5 years ago

mingchen62 commented 5 years ago

Not sure if it is pytorch-transformer issue. Environment: python 3.7.3, requests 2.22.0, urllib3 1.24.1,

Stack trace: INFO:pytorch_transformers.file_utils:https://s3.amazonaws.com/models.huggingface.co/bert/xlm-mlm-en-2048-pytorch_model.bin not found in cache, downloading to /tmp/tmp10cg6rcl 25%|█████████████████████▊ | 676553728/2668510627 [01:07<03:12, 10331611.59B/s]Traceback (most recent call last): File "transformer-compliance.py", line 99, in model = model_class.from_pretrained(args['model_name']) File "/home/anaconda3/lib/python3.7/site-packages/pytorch_transformers/modeling_utils.py", line 452, in from_pretrained resolved_archive_file = cached_path(archive_file, cache_dir=cache_dir) File "/home/anaconda3/lib/python3.7/site-packages/pytorch_transformers/file_utils.py", line 114, in cached_path return get_from_cache(url_or_filename, cache_dir) File "/home/anaconda3/lib/python3.7/site-packages/pytorch_transformers/file_utils.py", line 240, in get_from_cache http_get(url, temp_file) File "/home/anaconda3/lib/python3.7/site-packages/pytorch_transformers/file_utils.py", line 180, in http_get for chunk in req.iter_content(chunk_size=1024): File "/home/anaconda3/lib/python3.7/site-packages/requests/models.py", line 750, in generate for chunk in self.raw.stream(chunk_size, decode_content=True): File "/home/anaconda3/lib/python3.7/site-packages/urllib3/response.py", line 494, in stream data = self.read(amt=amt, decode_content=decode_content) File "/home/anaconda3/lib/python3.7/site-packages/urllib3/response.py", line 442, in read data = self._fp.read(amt) File "/home/anaconda3/lib/python3.7/http/client.py", line 447, in read n = self.readinto(b) File "/home/anaconda3/lib/python3.7/http/client.py", line 491, in readinto n = self.fp.readinto(b) File "/home/anaconda3/lib/python3.7/socket.py", line 589, in readinto return self._sock.recv_into(b) File "/home/anaconda3/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 294, in recv_into return self.connection.recv_into(*args, **kwargs) File "/home/anaconda3/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1822, in recv_into self._raise_ssl_error(self._ssl, result) File "/home/anaconda3/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1647, in _raise_ssl_error _raise_current_error() File "/home/anaconda3/lib/python3.7/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue raise exception_type(errors) OpenSSL.SSL.Error: [('SSL routines', 'ssl3_get_record', 'decryption failed or bad record mac')]

Does anyone encounter this issue? thanks

ThilinaRajapakse commented 5 years ago

That's one I haven't seen. But according to this, it seems to be a Debian issue, rather than Pytorch or pytorch-transformers. What OS are you using? I can confirm that this works on Ubuntu 18.04.

mingchen62 commented 5 years ago

Yes, it should be OS/SSL issue. thanks for the info. I am using Ubuntu 16. closing this ticket,