Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
agarnitin86 opened this issue Apr 1, 2019 · 1 comment

Comments

@agarnitin86
Copy link

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)

@pati-dev
Copy link

pati-dev commented Aug 7, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants