Open antoinecomp opened 6 years ago
Same thing is happening to me. infersent = torch.load('InferSent/encoder/infersent.allnli.pickle', map_location=lambda storage, loc: storage) infersent.set_glove_path("InferSent/dataset/GloVe/glove.840B.300d.txt")
FileNotFoundError Traceback (most recent call last)
You can download the model and missing glove file by following the instructions here: https://github.com/facebookresearch/InferSent
When compiling the code, make sure to have the 'models.py' file in the app directory, or you'll come across this issue: https://github.com/facebookresearch/InferSent/issues/11
i really want solution for this issue i am also getting the same error ileNotFoundError Traceback (most recent call last) in () ----> 1 infersent = torch.load('InferSent/encoder/infersent.allnli.pickle', map_location=lambda storage, loc: storage) 2 infersent.set_glove_path("InferSent/dataset/GloVe/glove.840B.300d.txt")
~/anaconda3/envs/snake2/lib/python3.6/site-packages/torch/serialization.py in load(f, map_location, pickle_module) 299 (sys.version_info[0] == 3 and isinstance(f, pathlib.Path)): 300 new_fd = True --> 301 f = open(f, 'rb') 302 try: 303 return _load(f, map_location, pickle_module)
FileNotFoundError: [Errno 2] No such file or directory: 'InferSent/encoder/infersent.allnli.pickle'
infersent = torch.load('InferSent/encoder/infersent.allnli.pickle', map_location=lambda storage, loc: storage) infersent.allnli.pickle is an old version of the infersent model. Go to the link charklewis provided (https://github.com/facebookresearch/InferSent), read the readme.md. At the "Use our sentence encoder" section, there is instruction of how to download the pkl file
I tried to reproduce your create_emb.ipynb but I have issues with
infersent = torch.load('InferSent/encoder/infersent.allnli.pickle', map_location=lambda storage, loc: storage)
I tried to look on InterSent/encoder folder here but nothing appears to be named
infersent.allnli.pickle
. Maybe you're referencing an old version ? Maybe I'm wrong because I neither see the infersent.pickle they are referencing.