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
Describe the bug
When I run DIEN model, I get this error. I tried lengths.cpu(), lengths.to('cpu') but none of them work. Would you provide a solution for this?
DIEN_augru
HBox(children=(FloatProgress(value=0.0, description='training routine', max=2.0, style=ProgressStyle(descripti…
HBox(children=(FloatProgress(value=0.0, description='train', max=8486.0, style=ProgressStyle(description_width…
HBox(children=(FloatProgress(value=0.0, description='valid', max=947.0, style=ProgressStyle(description_width=…
GPU is available, transfer model to GPU.
Traceback (most recent call last):
File "<ipython-input-47-cf075d4611bd>", line 18, in <module>
scores1, model_loss_curves1 = run(models)
File "<ipython-input-47-cf075d4611bd>", line 9, in run
train_loader, valid_loader, notebook=True, auxiliary_loss_rate=1)
File "/home/hojun/anaconda3/envs/ai/lib/python3.6/site-packages/prediction_flow/pytorch/functions.py", line 57, in fit
pred = model(batch)
File "/home/hojun/anaconda3/envs/ai/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/hojun/anaconda3/envs/ai/lib/python3.6/site-packages/prediction_flow/pytorch/dien.py", line 100, in forward
query, pos_hist, keys_length, neg_hist))
File "/home/hojun/anaconda3/envs/ai/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/hojun/anaconda3/envs/ai/lib/python3.6/site-packages/prediction_flow/pytorch/nn/interest.py", line 235, in forward
enforce_sorted=False)
File "/home/hojun/anaconda3/envs/ai/lib/python3.6/site-packages/torch/nn/utils/rnn.py", line 244, in pack_padded_sequence
_VF._pack_padded_sequence(input, lengths, batch_first)
RuntimeError: 'lengths' argument should be a 1D CPU int64 tensor, but got 1D cuda:0 Long tensor
Additional context
Pytorch 1.7.1v
The text was updated successfully, but these errors were encountered:
Describe the bug
When I run DIEN model, I get this error. I tried lengths.cpu(), lengths.to('cpu') but none of them work. Would you provide a solution for this?
Additional context
Pytorch 1.7.1v
The text was updated successfully, but these errors were encountered: