Closed gopinath-r closed 5 years ago
Thanks gopi,
This issue is because the infersent models were not available in the given link. So whatever the models that are been downloaded they doesn't contain any data.
These links on the README page are expired.
curl -Lo encoder/infersent1.pkl https://s3.amazonaws.com/senteval/infersent/infersent1.pkl curl -Lo encoder/infersent2.pkl https://s3.amazonaws.com/senteval/infersent/infersent2.pkl
Facing the same issue :
from models import InferSent model_version = 2 MODEL_PATH = "/mnt/ebs2/apis/pretrained/infersent/infersent%s.pkl" % model_version params_model = {'bsize': 64, 'word_emb_dim': 300, 'enc_lstm_dim': 2048, ... 'pool_type': 'max', 'dpout_model': 0.0, 'version': model_version}
model = InferSent(params_model) model.load_state_dict(torch.load(MODEL_PATH))
import torch model.load_state_dict(torch.load(MODEL_PATH)) Traceback (most recent call last): File "
", line 1, in File "/mnt/ebs2/apis/mlengine/p2env/lib/python2.7/site-packages/torch/serialization.py", line 368, in load return _load(f, map_location, pickle_module) File "/mnt/ebs2/apis/mlengine/p2env/lib/python2.7/site-packages/torch/serialization.py", line 532, in _load magic_number = pickle_module.load(f) cPickle.UnpicklingError: invalid load key, '<'.
I am also facing the same issue (which I refiled because this is not resolved).
This repo requires a banner "shelved" on top of Readme to save people's time I think. Or else the pickle file can be provided again. :)))
Hi,
I am facing issue while loading the trained model.
from models import InferSent V = 2 MODEL_PATH = 'encoder/infersent%s.pkl' % V params_model = {'bsize': 64, 'word_emb_dim': 300, 'enc_lstm_dim': 2048, 'pool_type': 'max', 'dpout_model': 0.0, 'version': V} infersent = InferSent(params_model) infersent.load_state_dict(torch.load(MODEL_PATH))
I am getting the following error
UnpicklingError Traceback (most recent call last)