bheinzerling / bpemb

Pre-trained subword embeddings in 275 languages, based on Byte-Pair Encoding (BPE)
https://nlp.h-its.org/bpemb
MIT License
1.18k stars 101 forks source link

AttributeError: module 'smart_open' has no attribute 's3' #37

Closed ssp573 closed 4 years ago

ssp573 commented 4 years ago

I am using this module on a sagemaker inference instance. I have started getting this error since yesterday. It worked very well before that. Here is a full stack trace I get in the logs.

Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/sagemaker_containers/_functions.py", line 85, in wrapper return fn(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/serve_with_confidence.py", line 47, in input_fn message = get_BPEmb_tokenized(message, max_length=MAX_LEN) File "/usr/local/lib/python3.6/dist-packages/serve_with_confidence.py", line 37, in get_BPEmb_tokenized bpemb_en = BPEmb(lang="en", dim=300, preprocess=False) File "/usr/local/lib/python3.6/dist-packages/bpemb/bpemb.py", line 156, in init self.emb = load_word2vec_file(self.emb_file, add_pad=add_pad_emb) File "/usr/local/lib/python3.6/dist-packages/bpemb/util.py", line 67, in load_word2vec_file from gensim.models import KeyedVectors File "/usr/local/lib/python3.6/dist-packages/gensim/init.py", line 5, in from gensim import parsing, corpora, matutils, interfaces, models, similarities, summarization, utils # noqa:F401 File "/usr/local/lib/python3.6/dist-packages/gensim/parsing/init.py", line 4, in from .preprocessing import (remove_stopwords, strip_punctuation, strip_punctuation2, # noqa:F401 File "/usr/local/lib/python3.6/dist-packages/gensim/parsing/preprocessing.py", line 42, in from gensim import utils File "/usr/local/lib/python3.6/dist-packages/gensim/utils.py", line 45, in from smart_open import open File "/usr/local/lib/python3.6/dist-packages/smart_open/init.py", line 27, in from .smart_open_lib import open, smart_open, register_compressor File "/usr/local/lib/python3.6/dist-packages/smart_open/smart_open_lib.py", line 38, in import smart_open.s3 as smart_open_s3

bheinzerling commented 4 years ago

This is some issue with the smart_open package. Can you try reinstalling this package to make sure it is installed correctly? It looks like there was a version update two days ago (to 1.10.0), maybe it's related to that? If the latest version doesn't work, you could also try installing an earlier version (e.g. 1.9.0) and see if the issue goes away.