ABSA-PyTorch icon indicating copy to clipboard operation
ABSA-PyTorch copied to clipboard

RAM model: RuntimeError: Expected object of scalar type Float but got scalar type Long

Open Nivek92 opened this issue 5 years ago • 1 comments

When I run

python3 train.py --model_name ram --dataset restaurant --learning_rate 1e-3 --num_epoch 200

I get

RuntimeError: Expected object of scalar type Float but got scalar type Long for sequence element 1 in sequence argument at position #1 'tensors'

Nivek92 avatar Jun 20 '19 11:06 Nivek92

In locationed_memory() function, you should add the following line: u = u.type(torch.FloatTensor).to(self.opt.device)

nghidinhit avatar Jun 22 '19 02:06 nghidinhit