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
Traceback (most recent call last): ] 0% loss = ...
File "train.py", line 183, in
main()
File "train.py", line 111, in main
train_model(model, opt)
File "train.py", line 34, in train_model
src_mask, trg_mask = create_masks(src, trg_input, opt)
File "/dockerdata/bert_seq2seq/Transformer-master/Batch.py", line 25, in create_masks
trg_mask = trg_mask & np_mask
RuntimeError: Expected object of device type cuda but got device type cpu for argument #1 'self' in call to _th_and
how to solve the problem
The text was updated successfully, but these errors were encountered:
Traceback (most recent call last): ] 0% loss = ...
File "train.py", line 183, in
main()
File "train.py", line 111, in main
train_model(model, opt)
File "train.py", line 34, in train_model
src_mask, trg_mask = create_masks(src, trg_input, opt)
File "/dockerdata/bert_seq2seq/Transformer-master/Batch.py", line 25, in create_masks
trg_mask = trg_mask & np_mask
RuntimeError: Expected object of device type cuda but got device type cpu for argument #1 'self' in call to _th_and
how to solve the problem
Check your device, I would suggest to pass it as a parameter in all function calls to avoid device conflict.
Traceback (most recent call last): ] 0% loss = ...
File "train.py", line 183, in
main()
File "train.py", line 111, in main
train_model(model, opt)
File "train.py", line 34, in train_model
src_mask, trg_mask = create_masks(src, trg_input, opt)
File "/dockerdata/bert_seq2seq/Transformer-master/Batch.py", line 25, in create_masks
trg_mask = trg_mask & np_mask
RuntimeError: Expected object of device type cuda but got device type cpu for argument #1 'self' in call to _th_and
how to solve the problem
The text was updated successfully, but these errors were encountered: