Unsupervised-Aspect-Extraction icon indicating copy to clipboard operation
Unsupervised-Aspect-Extraction copied to clipboard

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc1 in position 0: ordinal not in range(128)

Open agarnitin86 opened this issue 6 years ago • 1 comments

I am using gensim 0.12.4 on python 3 and still getting the following error

Traceback (most recent call last):

File "", line 1, in model = create_model(ortho_reg, neg_size, emb_dim, aspect_size, emb_path, overall_maxlen, vocab)

File "/home/fractaluser/Projects/workspace/UnsupervisedAspectExtraction/code/model.py", line 63, in create_model emb_reader = EmbReader(emb_path, emb_dim=emb_dim)

File "/home/fractaluser/Projects/workspace/UnsupervisedAspectExtraction/code/w2v_emb_reader.py", line 23, in init model = gensim.models.Word2Vec.load(emb_path)

File "/home/fractaluser/anaconda3/envs/venv_keras/lib/python3.5/site-packages/gensim/models/word2vec.py", line 1485, in load model = super(Word2Vec, cls).load(*args, **kwargs)

File "/home/fractaluser/anaconda3/envs/venv_keras/lib/python3.5/site-packages/gensim/utils.py", line 248, in load obj = unpickle(fname)

File "/home/fractaluser/anaconda3/envs/venv_keras/lib/python3.5/site-packages/gensim/utils.py", line 912, in unpickle return _pickle.loads(f.read())

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc1 in position 0: ordinal not in range(128)

agarnitin86 avatar Apr 01 '19 09:04 agarnitin86

I'm getting the same error. Is there any fix available for this?

Edit: Found the solution. This issue is because of using Python3 instead of Python2.7. As recommended by the author, use Python2.7 to run the code.

pati-dev avatar Aug 07 '19 23:08 pati-dev