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
Not able to use FP16 in pytorch-pretrained-BERT. Getting error **Runtime error: Expected scalar type object Half but got scalar type Float for argument #2 target**
#140
Closed
Ashish-Gupta03 opened this issue
Dec 20, 2018
· 3 comments
I'm not able to work with FP16 for pytorch BERT code. Particularly for BertForSequenceClassification, which I tried and got the issue Runtime error: Expected scalar type object Half but got scalar type Float for argument #2 target
when I enabled fp16.
Also when using logits = logits.half() labels = labels.half()
then the epoch time also increased.
The training time without fp16 was 2.5 hrs per epoch after doing logits.half() and labels.half() the runtime per epoch shot up to 8hrs.
The text was updated successfully, but these errors were encountered:
Ashish-Gupta03
changed the title
Not able to use FP16 in pytorch-pretrained-BERT. Getting error
Not able to use FP16 in pytorch-pretrained-BERT. Getting error **Runtime error: Expected scalar type object Half but got scalar type Float for argument #2 target**
Dec 20, 2018
I'm not able to work with FP16 for pytorch BERT code. Particularly for BertForSequenceClassification, which I tried and got the issue
Runtime error: Expected scalar type object Half but got scalar type Float for argument #2 target
when I enabled fp16.
Also when using
logits = logits.half() labels = labels.half()
then the epoch time also increased.
The training time without fp16 was 2.5 hrs per epoch after doing logits.half() and labels.half() the runtime per epoch shot up to 8hrs.
The text was updated successfully, but these errors were encountered: