I have this code part for training a Bert model:
from fastai.callbacks import *
learner = Learner(
databunch, bert_model,
loss_func=loss_func,
)
learner.lr_find()
and facing this runtime error
/usr/local/lib/python3.6/dist-packages/pytorch_pretrained_bert/modeling.py in forward(self, x)
240 def forward(self, x):
241 u = x.mean(-1, keepdim=True)
--> 242 s = pow((x - u),2).mean(-1, keepdim=True)
243 x = (x - u) / torch.sqrt(s + self.variance_epsilon)
244 return self.weight * x + self.bias
RuntimeError: "pow" not implemented for 'Half'
How can I solve this issue? Any help would be great!
Thanks
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…