nlx-group/WordNetEmbeddings

Problem in loading model

Opened this issue · 1 comments

Problem in loading model

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'.