"No such file or directory" error when running setup docker-compose service
fhightower opened this issue Β· comments
Hi extra-modelers π !
When running docker-compose run --rm setup
, I get the following error:
Formatting file. This will take approximately 10 minutes.
loading projection weights from /usr/local/lib/python3.8/site-packages/gensim/test/test_data/embeddings/glove.840B.300d.txt
Traceback (most recent call last):
File "/usr/local/bin/extra-model-setup", line 33, in <module>
sys.exit(load_entry_point('extra-model', 'console_scripts', 'extra-model-setup')())
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/package/extra_model/_cli.py", line 65, in entrypoint_setup
setup(output_path)
File "/package/extra_model/_setup.py", line 41, in setup
format_file(file_unzipped, output_path)
File "/package/extra_model/_setup.py", line 84, in format_file
_ = glove2word2vec(glove_file, tmp_file)
File "/usr/local/lib/python3.8/site-packages/gensim/utils.py", line 1519, in new_func1
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/gensim/scripts/glove2word2vec.py", line 109, in glove2word2vec
glovekv = KeyedVectors.load_word2vec_format(glove_input_file, binary=False, no_header=True)
File "/usr/local/lib/python3.8/site-packages/gensim/models/keyedvectors.py", line 1630, in load_word2vec_format
return _load_word2vec_format(
File "/usr/local/lib/python3.8/site-packages/gensim/models/keyedvectors.py", line 1892, in _load_word2vec_format
with utils.open(fname, 'rb') as fin:
File "/usr/local/lib/python3.8/site-packages/smart_open/smart_open_lib.py", line 180, in open
fobj = _shortcut_open(
File "/usr/local/lib/python3.8/site-packages/smart_open/smart_open_lib.py", line 287, in _shortcut_open
return _builtin_open(local_path, mode, buffering=buffering, **open_kwargs)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.8/site-packages/gensim/test/test_data/embeddings/glove.840B.300d.txt'
ERROR: 1
I believe this occurs because the glove_file
argument being passed into glove2word2vec
here is a relative path. I haven't had a chance to experiment yet, but I think changing it to an absolute path will resolve this error.
you are right, I've fixed it along with another issue in the setup script.