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

Problem in loading model #2

Open
fatmalearningphd opened this issue Nov 12, 2019 · 1 comment
Open

Problem in loading model #2

fatmalearningphd opened this issue Nov 12, 2019 · 1 comment

Comments

@fatmalearningphd
Copy link

No description provided.

@fatmalearningphd
Copy link
Author

I am trying to use wn2vec.txt model
#from google.colab import drive drive.mount('/content/drive/',force_remount=True) os.chdir('/content/drive/My Drive/download/Embeding_Wordnet/') !wget http://lxcenter.di.fc.ul.pt/wn2vec.zip !sudo apt-get install unzip !unzip wn2vec.zip from gensim.test.utils import common_texts, get_tmpfile from gensim.models import Word2Vec path = get_tmpfile("wn2vec.txt") #model = Word2Vec(common_texts, size=100, window=5, min_count=1, workers=4) #model.save("wn2vec.model") model = Word2Vec.load("wn2vec.txt")
It displayed this error

/usr/local/lib/python3.6/dist-packages/smart_open/smart_open_lib.py:402: UserWarning: This function is deprecated, use smart_open.open instead. See the migration notes for details: https://github.com/RaRe-Technologies/smart_open/blob/master/README.rst#migrating-to-the-new-open-function
'See the migration notes for details: %s' % _MIGRATION_NOTES_URL


UnpicklingError Traceback (most recent call last)
in ()
4 #model = Word2Vec(common_texts, size=100, window=5, min_count=1, workers=4)
5 #model.save("wn2vec.model")
----> 6 model = Word2Vec.load("wn2vec.txt")

4 frames
/usr/local/lib/python3.6/dist-packages/gensim/utils.py in unpickle(fname)
1359 # Because of loading from S3 load can't be used (missing readline in smart_open)
1360 if sys.version_info > (3, 0):
-> 1361 return _pickle.load(f, encoding='latin1')
1362 else:
1363 return _pickle.loads(f.read())

UnpicklingError: invalid load key, '6'.

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

1 participant