sz128/slot_filling_and_intent_detection_of_SLU

error Connection broken when running python3 scripts/get_ELMo_word_embedding_for_a_dataset.py

UnknownVillage opened this issue · 1 comments

I run the command:
python3 scripts/get_ELMo_word_embedding_for_a_dataset.py \

--in_files data/atis-2/{train,valid,test}
--output_word2vec local/word_embeddings/elmo_1024_cased_for_atis.txt

2%|████▍ | 8773632/374434792 [01:56<1:33:25, 65227.37B/s]

Traceback (most recent call last):
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 294, in recv_into
return self.connection.recv_into(*args, **kwargs)
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1822, in recv_into
self._raise_ssl_error(self._ssl, result)
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1639, in _raise_ssl_error
raise SysCallError(errno, errorcode.get(errno))
OpenSSL.SSL.SysCallError: (104, 'ECONNRESET')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/urllib3/response.py", line 360, in _error_catcher
yield
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/urllib3/response.py", line 442, in read
data = self._fp.read(amt)
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/http/client.py", line 449, in read
n = self.readinto(b)
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/http/client.py", line 493, in readinto
n = self.fp.readinto(b)
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/socket.py", line 586, in readinto
return self._sock.recv_into(b)
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 299, in recv_into
raise SocketError(str(e))
OSError: (104, 'ECONNRESET')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/requests/models.py", line 750, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/urllib3/response.py", line 494, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/urllib3/response.py", line 459, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/contextlib.py", line 99, in exit
self.gen.throw(type, value, traceback)
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/urllib3/response.py", line 378, in _error_catcher
raise ProtocolError('Connection broken: %r' % e, e)
urllib3.exceptions.ProtocolError: ('Connection broken: OSError("(104, 'ECONNRESET')",)', OSError("(104, 'ECONNRESET')",))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "scripts/get_ELMo_word_embedding_for_a_dataset.py", line 97, in
to_get_elmo_embeddings = elmo_embeddings(options_file, weight_file)
File "scripts/get_ELMo_word_embedding_for_a_dataset.py", line 22, in init
vocab_to_cache=None)
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/allennlp/modules/elmo.py", line 524, in init
self._token_embedder = _ElmoCharacterEncoder(options_file, weight_file, requires_grad=requires_grad)
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/allennlp/modules/elmo.py", line 310, in init
self._load_weights()
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/allennlp/modules/elmo.py", line 398, in _load_weights
self._load_char_embedding()
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/allennlp/modules/elmo.py", line 404, in _load_char_embedding
with h5py.File(cached_path(self._weight_file), 'r') as fin:
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/allennlp/common/file_utils.py", line 98, in cached_path
return get_from_cache(url_or_filename, cache_dir)
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/allennlp/common/file_utils.py", line 217, in get_from_cache
http_get(url, temp_file)
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/allennlp/common/file_utils.py", line 174, in http_get
for chunk in req.iter_content(chunk_size=1024):
File "/opt/anaconda2/envs/tensorflow36_wb/lib/python3.6/site-packages/requests/models.py", line 753, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: OSError("(104, 'ECONNRESET')",)', OSError("(104, 'ECONNRESET')",))
2%|████▍

sz128 commented

I believe that it is an error about internet connection. Just try it again.

You can also download the model manually, then run this scripts by using the commented code as follows:

elmo_json_file="https://allennlp.s3.amazonaws.com/models/elmo/2x4096_512_2048cnn_2xhighway/elmo_2x4096_512_2048cnn_2xhighway_options.json"
elmo_weight_file="https://allennlp.s3.amazonaws.com/models/elmo/2x4096_512_2048cnn_2xhighway/elmo_2x4096_512_2048cnn_2xhighway_weights.hdf5"
#elmo_json_file=../data/pretrained_models/language_model/ELMo_allenai/models/elmo/2x4096_512_2048cnn_2xhighway/elmo_2x4096_512_2048cnn_2xhighway_options.json
#elmo_weight_file=../data/pretrained_models/language_model/ELMo_allenai/models/elmo/2x4096_512_2048cnn_2xhighway/elmo_2x4096_512_2048cnn_2xhighway_weights.hdf5