You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am getting the following error which I believe has something to do with cuda and cpu version. Anyone face the same problem? I would appreciate help.
Traceback (most recent call last):
File "infersent.py", line 76, in <module>
results = se.eval(transfer_tasks)
File "../senteval/engine.py", line 59, in eval
self.results = {x: self.eval(x) for x in name}
File "../senteval/engine.py", line 59, in <dictcomp>
self.results = {x: self.eval(x) for x in name}
File "../senteval/engine.py", line 121, in eval
self.results = self.evaluation.run(self.params, self.batcher)
File "../senteval/mrpc.py", line 74, in run
embeddings = batcher(params, batch)
File "infersent.py", line 43, in batcher
embeddings = params.infersent.encode(sentences, bsize=params.batch_size, tokenize=False)
File "/tilde/fbrahman/parc/SentEval/examples/models.py", line 226, in encode
(batch, lengths[stidx:stidx + bsize])).data.cpu().numpy()
File "/tilde/fbrahman/parc/SentEval/examples/models.py", line 68, in forward
sent_output = self.enc_lstm(sent_packed)[0] # seqlen x batch x 2*nhid
File "/tilde/fbrahman/anaconda3/envs/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
result = self.forward(*input, **kwargs)
File "/tilde/fbrahman/anaconda3/envs/py36/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 192, in forward
output, hidden = func(input, self.all_weights, hx, batch_sizes)
File "/tilde/fbrahman/anaconda3/envs/py36/lib/python3.6/site-packages/torch/nn/_functions/rnn.py", line 324, in forward
return func(input, *fargs, **fkwargs)
File "/tilde/fbrahman/anaconda3/envs/py36/lib/python3.6/site-packages/torch/nn/_functions/rnn.py", line 244, in forward
nexth, output = func(input, hidden, weight, batch_sizes)
File "/tilde/fbrahman/anaconda3/envs/py36/lib/python3.6/site-packages/torch/nn/_functions/rnn.py", line 87, in forward
hy, output = inner(input, hidden[l], weight[l], batch_sizes)
File "/tilde/fbrahman/anaconda3/envs/py36/lib/python3.6/site-packages/torch/nn/_functions/rnn.py", line 159, in forward
hidden = inner(step_input, hidden, *weight)
File "/tilde/fbrahman/anaconda3/envs/py36/lib/python3.6/site-packages/torch/nn/_functions/rnn.py", line 34, in LSTMCell
gates = F.linear(input, w_ih, b_ih) + F.linear(hx, w_hh, b_hh)
File "/tilde/fbrahman/anaconda3/envs/py36/lib/python3.6/site-packages/torch/nn/functional.py", line 1024, in linear
return torch.addmm(bias, input, weight.t())
RuntimeError: Expected object of type torch.cuda.FloatTensor but found type torch.FloatTensor for argument #4 'mat1'
The text was updated successfully, but these errors were encountered:
I tried degrading pytorch to version 0.3.1 and I did not get this error anymore, however, with that version I am getting error with data.items() as follows:
Traceback (most recent call last):
File "bow.py", line 111, in <module>
results = se.eval(transfer_tasks)
File "../senteval/engine.py", line 59, in eval
self.results = {x: self.eval(x) for x in name}
File "../senteval/engine.py", line 59, in <dictcomp>
self.results = {x: self.eval(x) for x in name}
File "../senteval/engine.py", line 121, in eval
self.results = self.evaluation.run(self.params, self.batcher)
File "../senteval/mrpc.py", line 99, in run
devacc, testacc, yhat = clf.run()
File "../senteval/tools/validation.py", line 150, in run
clf.fit(X_train, y_train, validation_data=(X_test, y_test))
File "../senteval/tools/classifier.py", line 78, in fit
self.trainepoch(trainX, trainy, epoch_size=self.epoch_size)
File "../senteval/tools/classifier.py", line 108, in trainepoch
all_costs.append(loss.data.item())
AttributeError: 'torch.cuda.FloatTensor' object has no attribute 'item'
Hi, I am getting the following error which I believe has something to do with cuda and cpu version. Anyone face the same problem? I would appreciate help.
The text was updated successfully, but these errors were encountered: